Re: [systemd-devel] user service not starting on login

2019-05-12 Thread Topi Miettinen

On 12.5.2019 18.08, Matt Zagrabelny wrote:

Hey Mantas and others,

On Thu, May 9, 2019 at 11:57 PM Mantas Mikulėnas > wrote:


On Fri, May 10, 2019 at 5:22 AM Matt Zagrabelny mailto:mzagr...@d.umn.edu>> wrote:

Greetings,

I am attempting to get a user service running on my session login.

The unit is called jack. I've enabled it via:

$ systemctl --user enable jack

When I boot up the system and log in I see that it is inactive.
I can start it manually without issue:

$ systemctl --user status jack
● jack.service - JACK 2
    Loaded: loaded
(/home/theophilus/.config/systemd/user/jack.service; enabled;
vendor preset: enabled)
    Active: inactive (dead)

$ journalctl --user -u jack -b
-- Logs begin at Thu 2019-05-09 20:54:31 CDT, end at Thu
2019-05-09 21:13:53 CDT. --
-- No entries --

$ systemctl --user cat jack
# /home/theophilus/.config/systemd/user/jack.service
[Unit]
Description=JACK 2
Before=sound.target
Before=pulseaudio.service
Requires=dbus.socket

[Service]
Type=dbus
BusName=org.jackaudio.Controller


Among other things, the bus name seems to be incorrect. In
jack2-dbus the only claimed name appears to be "org.jackaudio.service".

ExecStart=/usr/bin/jack_control start


The jack_control program does not spawn nor directly execute the
actual jackd daemon. Instead it *remotely*
activates org.jackaudio.service through D-Bus (you'll see jackdbus
under the dbus.service cgroup), then sends it a single method call
and exits.

In other words, jack_control is not a Type=dbus service, it's a
oneshot script that controls another Type=dbus service. You can
imagine that it's just a wrapper around `dbus-send` or `gdbus call`,
and is something you'd instead use in JACK's *ExecStartPost=*.

A direct conversion of jackdbus to a systemd service would look like
this – because of the way jackdbus is written, it always needs that
extra command to be sent over D-Bus (either by running `jack_control
start` or by using the manual tools):

(~/.config/systemd/user/jack.service)
[Service]
Type=dbus
BusName=org.jackaudio.service
ExecStart=/usr/bin/jackdbus auto
#ExecStartPost=/usr/bin/jack_control start
#ExecStartPost=/usr/bin/gdbus call -e -d org.jackaudio.service -o
/org/jackaudio/Controller -m org.jackaudio.JackControl.StartServer
ExecStartPost=/usr/bin/busctl call --user org.jackaudio.service
/org/jackaudio/Controller org.jackaudio.JackControl StartServer


I used this service file (thank you for providing it!), but it seems 
jack is still not starting when the user logs in to the session:


$ systemctl --user status jack
● jack.service
    Loaded: loaded (/home/theophilus/.config/systemd/user/jack.service; 
enabled; vendor preset: enabled)

    Active: inactive (dead)

$ ps -ef | grep jack
theophi+  1200  1183  0 09:30 pts/3    00:00:00 grep jack

$ systemctl --user status jack
● jack.service
    Loaded: loaded (/home/theophilus/.config/systemd/user/jack.service; 
enabled; vendor preset: enabled)

    Active: inactive (dead)

$ systemctl --user cat jack
# /home/theophilus/.config/systemd/user/jack.service
[Service]
Type=dbus
BusName=org.jackaudio.service
ExecStart=/usr/bin/jackdbus auto
#ExecStartPost=/usr/bin/jack_control start
#ExecStartPost=/usr/bin/gdbus call -e -d org.jackaudio.service -o 
/org/jackaudio/Controller -m org.jackaudio.JackControl.StartServer
ExecStartPost=/usr/bin/busctl call --user org.jackaudio.service 
/org/jackaudio/Controller org.jackaudio.JackControl StartServer


You are missing:

[Install]
WantedBy=default.target

Then when you enable it, systemd should create a symbolic link in directory
.config/systemd/user/default.target.wants
to your service.

-Topi



$ systemctl --user is-enabled jack
enabled

$ systemctl --user is-active jack
inactive

$ systemctl --user | grep jack

$ systemctl --user | grep bus
at-spi-dbus-bus.service  
                              loaded active running   Accessibility 
services bus
dbus.service
                               loaded active running   D-Bus User 
Message Bus
dbus.socket  
                              loaded active running   D-Bus User Message 
Bus Socket


If I start ardour (which makes use of jack) it (ardour) tells me jack is 
not running.


I can start the jack service:

$ systemctl --user start jack

So...

How can I figure out why it is not starting automatically?

Thanks!

-m

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org

Re: [systemd-devel] user service not starting on login

2019-05-12 Thread Matt Zagrabelny
Hey Mantas and others,

On Thu, May 9, 2019 at 11:57 PM Mantas Mikulėnas  wrote:

> On Fri, May 10, 2019 at 5:22 AM Matt Zagrabelny 
> wrote:
>
>> Greetings,
>>
>> I am attempting to get a user service running on my session login.
>>
>> The unit is called jack. I've enabled it via:
>>
>> $ systemctl --user enable jack
>>
>> When I boot up the system and log in I see that it is inactive. I can
>> start it manually without issue:
>>
>> $ systemctl --user status jack
>> ● jack.service - JACK 2
>>Loaded: loaded (/home/theophilus/.config/systemd/user/jack.service;
>> enabled; vendor preset: enabled)
>>Active: inactive (dead)
>>
>> $ journalctl --user -u jack -b
>> -- Logs begin at Thu 2019-05-09 20:54:31 CDT, end at Thu 2019-05-09
>> 21:13:53 CDT. --
>> -- No entries --
>>
>> $ systemctl --user cat jack
>> # /home/theophilus/.config/systemd/user/jack.service
>> [Unit]
>> Description=JACK 2
>> Before=sound.target
>> Before=pulseaudio.service
>> Requires=dbus.socket
>>
>> [Service]
>> Type=dbus
>> BusName=org.jackaudio.Controller
>>
>
> Among other things, the bus name seems to be incorrect. In jack2-dbus the
> only claimed name appears to be "org.jackaudio.service".
>
>
>> ExecStart=/usr/bin/jack_control start
>>
>
> The jack_control program does not spawn nor directly execute the actual
> jackd daemon. Instead it *remotely* activates org.jackaudio.service through
> D-Bus (you'll see jackdbus under the dbus.service cgroup), then sends it a
> single method call and exits.
>
> In other words, jack_control is not a Type=dbus service, it's a oneshot
> script that controls another Type=dbus service. You can imagine that it's
> just a wrapper around `dbus-send` or `gdbus call`, and is something you'd
> instead use in JACK's *ExecStartPost=*.
>
> A direct conversion of jackdbus to a systemd service would look like this
> – because of the way jackdbus is written, it always needs that extra
> command to be sent over D-Bus (either by running `jack_control start` or by
> using the manual tools):
>
> (~/.config/systemd/user/jack.service)
> [Service]
> Type=dbus
> BusName=org.jackaudio.service
> ExecStart=/usr/bin/jackdbus auto
> #ExecStartPost=/usr/bin/jack_control start
> #ExecStartPost=/usr/bin/gdbus call -e -d org.jackaudio.service -o
> /org/jackaudio/Controller -m org.jackaudio.JackControl.StartServer
> ExecStartPost=/usr/bin/busctl call --user org.jackaudio.service
> /org/jackaudio/Controller org.jackaudio.JackControl StartServer
>
>
I used this service file (thank you for providing it!), but it seems jack
is still not starting when the user logs in to the session:

$ systemctl --user status jack
● jack.service
   Loaded: loaded (/home/theophilus/.config/systemd/user/jack.service;
enabled; vendor preset: enabled)
   Active: inactive (dead)

$ ps -ef | grep jack
theophi+  1200  1183  0 09:30 pts/300:00:00 grep jack

$ systemctl --user status jack
● jack.service
   Loaded: loaded (/home/theophilus/.config/systemd/user/jack.service;
enabled; vendor preset: enabled)
   Active: inactive (dead)

$ systemctl --user cat jack
# /home/theophilus/.config/systemd/user/jack.service
[Service]
Type=dbus
BusName=org.jackaudio.service
ExecStart=/usr/bin/jackdbus auto
#ExecStartPost=/usr/bin/jack_control start
#ExecStartPost=/usr/bin/gdbus call -e -d org.jackaudio.service -o
/org/jackaudio/Controller -m org.jackaudio.JackControl.StartServer
ExecStartPost=/usr/bin/busctl call --user org.jackaudio.service
/org/jackaudio/Controller org.jackaudio.JackControl StartServer

$ systemctl --user is-enabled jack
enabled

$ systemctl --user is-active jack
inactive

$ systemctl --user | grep jack

$ systemctl --user | grep bus
at-spi-dbus-bus.service
   loaded active running   Accessibility services
bus
dbus.service
  loaded active running   D-Bus User Message Bus
dbus.socket
   loaded active running   D-Bus User Message Bus
Socket

If I start ardour (which makes use of jack) it (ardour) tells me jack is
not running.

I can start the jack service:

$ systemctl --user start jack

So...

How can I figure out why it is not starting automatically?

Thanks!

-m
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] user service not starting on login

2019-05-09 Thread Mantas Mikulėnas
On Fri, May 10, 2019 at 7:57 AM Mantas Mikulėnas  wrote:

> A direct conversion of jackdbus to a systemd service would look like this
> – because of the way jackdbus is written, it always needs that extra
> command to be sent over D-Bus (either by running `jack_control start` or by
> using the manual tools):
>
> (~/.config/systemd/user/jack.service)
> [Service]
> Type=dbus
> BusName=org.jackaudio.service
> ExecStart=/usr/bin/jackdbus auto
> #ExecStartPost=/usr/bin/jack_control start
> #ExecStartPost=/usr/bin/gdbus call -e -d org.jackaudio.service -o
> /org/jackaudio/Controller -m org.jackaudio.JackControl.StartServer
> ExecStartPost=/usr/bin/busctl call --user org.jackaudio.service
> /org/jackaudio/Controller org.jackaudio.JackControl StartServer
>
>
...and KillSignal=SIGKILL, I guess.

I wonder why it needs that.

-- 
Mantas Mikulėnas
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] user service not starting on login

2019-05-09 Thread Mantas Mikulėnas
On Fri, May 10, 2019 at 5:22 AM Matt Zagrabelny  wrote:

> Greetings,
>
> I am attempting to get a user service running on my session login.
>
> The unit is called jack. I've enabled it via:
>
> $ systemctl --user enable jack
>
> When I boot up the system and log in I see that it is inactive. I can
> start it manually without issue:
>
> $ systemctl --user status jack
> ● jack.service - JACK 2
>Loaded: loaded (/home/theophilus/.config/systemd/user/jack.service;
> enabled; vendor preset: enabled)
>Active: inactive (dead)
>
> $ journalctl --user -u jack -b
> -- Logs begin at Thu 2019-05-09 20:54:31 CDT, end at Thu 2019-05-09
> 21:13:53 CDT. --
> -- No entries --
>
> $ systemctl --user cat jack
> # /home/theophilus/.config/systemd/user/jack.service
> [Unit]
> Description=JACK 2
> Before=sound.target
> Before=pulseaudio.service
> Requires=dbus.socket
>
> [Service]
> Type=dbus
> BusName=org.jackaudio.Controller
>

Among other things, the bus name seems to be incorrect. In jack2-dbus the
only claimed name appears to be "org.jackaudio.service".


> ExecStart=/usr/bin/jack_control start
>

The jack_control program does not spawn nor directly execute the actual
jackd daemon. Instead it *remotely* activates org.jackaudio.service through
D-Bus (you'll see jackdbus under the dbus.service cgroup), then sends it a
single method call and exits.

In other words, jack_control is not a Type=dbus service, it's a oneshot
script that controls another Type=dbus service. You can imagine that it's
just a wrapper around `dbus-send` or `gdbus call`, and is something you'd
instead use in JACK's *ExecStartPost=*.

A direct conversion of jackdbus to a systemd service would look like this –
because of the way jackdbus is written, it always needs that extra command
to be sent over D-Bus (either by running `jack_control start` or by using
the manual tools):

(~/.config/systemd/user/jack.service)
[Service]
Type=dbus
BusName=org.jackaudio.service
ExecStart=/usr/bin/jackdbus auto
#ExecStartPost=/usr/bin/jack_control start
#ExecStartPost=/usr/bin/gdbus call -e -d org.jackaudio.service -o
/org/jackaudio/Controller -m org.jackaudio.JackControl.StartServer
ExecStartPost=/usr/bin/busctl call --user org.jackaudio.service
/org/jackaudio/Controller org.jackaudio.JackControl StartServer

I think you can even make manual jack_control invocations start your
systemd service using this:

(~/.local/share/dbus-1/services/org.jackaudio.service)
[D-BUS Service]
Name=org.jackaudio.service
Exec=/bin/false
SystemdService=jackservice

(Side note: The filename of the latter file should actually be
dbus-1/services/org.jackaudio.service.service [sic], but because JACK
already used the incorrect one in /usr/share, let's stick to it.)

-- 
Mantas Mikulėnas
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

[systemd-devel] user service not starting on login

2019-05-09 Thread Matt Zagrabelny
Greetings,

I am attempting to get a user service running on my session login.

The unit is called jack. I've enabled it via:

$ systemctl --user enable jack

When I boot up the system and log in I see that it is inactive. I can start
it manually without issue:

$ systemctl --user status jack
● jack.service - JACK 2
   Loaded: loaded (/home/theophilus/.config/systemd/user/jack.service;
enabled; vendor preset: enabled)
   Active: inactive (dead)

$ journalctl --user -u jack -b
-- Logs begin at Thu 2019-05-09 20:54:31 CDT, end at Thu 2019-05-09
21:13:53 CDT. --
-- No entries --

$ systemctl --user cat jack
# /home/theophilus/.config/systemd/user/jack.service
[Unit]
Description=JACK 2
Before=sound.target
Before=pulseaudio.service
Requires=dbus.socket

[Service]
Type=dbus
BusName=org.jackaudio.Controller
ExecStart=/usr/bin/jack_control start
ExecStop=/usr/bin/jack_control stop
ExecStopPost=/usr/bin/pkill -9 jackdbus
SuccessExitStatus=0
RemainAfterExit=true
#Restart=always
#RestartSec=5

[Install]
WantedBy=default.target
WantedBy=sound.target

$ systemctl --user start jack
$ systemctl --user status jack
● jack.service - JACK 2
   Loaded: loaded (/home/theophilus/.config/systemd/user/jack.service;
enabled; vendor preset: enabled)
   Active: active (exited) since Thu 2019-05-09 21:15:29 CDT; 4s ago

  Process: 1079 ExecStart=/usr/bin/jack_control start (code=exited,
status=0/SUCCESS)
 Main PID: 1079 (code=exited, status=0/SUCCESS)

May 09 21:15:29 calvary systemd[672]: Starting JACK 2...
May 09 21:15:29 calvary jack_control[1079]: --- start
May 09 21:15:29 calvary systemd[672]: Started JACK 2.

What am I missing?

Thanks for the help!

-m
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel