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

How to set up services depending on encrypted filesystems with systemd (was Re: How to do this ?)



Jonathan Dowland:
> Next step, adjust the daemon to depend on this. In my example,
> transmission-daemon supplies a .service file in the package. Copy this to
> /etc/systemd/system, and add a line (the line prefixed +):
>
> >  [Unit]
> >  Description=Transmission BitTorrent Daemon
> >  After=network.target
> > +Requires=torrents.mount
> >
> >  [Service]
> >  User=debian-transmission

That's certainly the case for Debian 7, but in Debian 8 I believe that
the systemd package will have this later growth of the mechanism:

    cat > /etc/systemd/system/transmission-daemon.service.d/requires-mount.conf
<< EOT
    [Unit]
    Requires=torrents.mount
    EOT
    systemctl daemon-reload

Obvious intended advantage: If the transmission-daemon changes its
service unit, you'll get the change in your next package upgrade
without further explicit work updating your private local copy of the
unit file.

* https://wiki.archlinux.org/index.php/systemd#Editing_provided_unit_files
* https://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
* ... and, of course, the (up-to-date) manual page for systemd.unit .


Reply to: