[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Where to put daemontools startup in systemd Jessie?



Jonathan Dowland:
> You need to write a .service file for your svscanboot script, and
> put it in /etc/systemd/user.

I did systemd units for this ages ago.  It's better to do this as two
units: a "path" unit that watches the service directory and a
"service" unit that is started when the service directory is found to
be non-empty.  And one doesn't need svscanboot at all, since
systemd's journal logs the output of svscan and does it better than
readproctitle does.

There are minor variants on these in the nosh-systemd-services
package, which runs the nosh daemontools-compatibility scanner under
systemd in a similar (but not quite the same, since nosh has a
separate socket-activated service manager and a choice of service
scanners) manner.  For more documentation, install the nosh-guide
package and read /usr/local/share/doc/nosh/svscan-startup.html .

 jdebp /etc/systemd/system %cat svscan.path
 [Unit]
 Description=Daemontools service monitor

 [Path]
 DirectoryNotEmpty=/service/
 Unit=svscan.service

 [Install]
 WantedBy=multi-user.target
 jdebp /etc/systemd/system %cat svscan.service
 [Unit]
 Description=Daemontools service scanner

 [Service]
 ExecStart=/usr/bin/svscan /service/
 Restart=always

 [Install]


Reply to: