[LAU] systemd woes with jackd and its permissions (raspbian)

Peter P. peterparker at fastmail.com
Mon Jan 28 13:04:36 CET 2019

Hi Len,

* Len Ovens <len at ovenwerks.net> [2019-01-28 01:59]:
> On Mon, 28 Jan 2019, Peter P. wrote:
> > Now I try to start jackd automatically from a systemd service file
> > created as /etc/systemd/system/jackd.service with the following
> why /etc/systemd/system and not /etc/systemd/user/?
Frankly, I don't know. It seems there are about three different places
for system-wide service files on Debian and I don't know if the
/etc/systemd/user/ is for user-supplied services or for user-services
installed system-wide or whatever. I read that /etc/systemd/system is
the place for things to go in and which will be untouched by apt

> > contents:
> > 
> > 	[Unit]
> > 	Description=jackd
> > 	After=sound.target
> > 	[Service]
> > 	User=peter
> Does systemd allow Group=audio
Had success without Group setting (see other email) now, thank you!

> > 	ExecStart=/usr/bin/jackd -d alsa -r 44100 -P
> Would it be better starting a bash -l -c to wrap jackd?
I would like to execute it from systemd right away to benfit from its
restart features, inter-unit dependecies and logging facilities. 

> You seem to be wanting to run this before any user is logged in. Does that
> mean the user will run automatically or unattended? If so, I would use a
> multi-terminal text session manager like screen which can start itself with
> a number of processes running. If started by dbus-launch, you would still
> have that functionality as well. hmm, I am thinking about this and realizing
> I have not tried this trick with systemd, but /etc/rc.local (which should
> still work with systemd).
I am trying systemd for the reason given above. There "must" be an
advantage of having it inside my OS and I want to put it to use. :)

> OK, from:
> http://man7.org/linux/man-pages/man5/systemd.exec.5.html
> Group=audio
> would start things as group audio and may have trouble writing logs etc. to
> the user directorys.
> starting the commandline with + has some effect on this but if that opens
> things or restricts them I am not sure.
> SupplementaryGroups=audio may give both group=user and group=audio
> Systemd should be set up for security and as such default to a lower
> security level rather than higher. So even though the user is a part of more
> than one group, the actual groups needed by the process may need to all
> listed.

It seems to specify limits in the service file is the way to go.

Thanks again!

More information about the Linux-audio-user mailing list