Michael Chapman <m...@very.puzzling.org> writes:
> On Thu, 15 Oct 2015, Stuart Longland wrote:
>> Assuming I have a few files distributed in the base package:
>>      /lib/systemd/system/comms-drivers.service
>>      /lib/systemd/system/comms-drivers@.service
>>
>> Ordinarily, one would tell systemd about template instances by creating
>> symbolic links.
>>
>> Suppose however I wanted to not do this, but instead, provide some
>> automatic discovery mechanism for systemd, so it could run a script that
>> would tell it what instances exist.
>>
>> Is there a mechanism for doing this in systemd?
>
> One approach you might want to consider is using a systemd generator
> [1] to create the instance symlinks automatically at boot, e.g.:

This was done for OpenVPN in Debian. As Stuart said he based his
sysvinit script on Debian's openvpn script, the systemd integration
might also help him.

The generator can be found at [2], the .service files at [3] and [4].

Ansgar

  [2] 
<http://anonscm.debian.org/cgit/collab-maint/openvpn.git/tree/debian/openvpn-generator>
  [3] 
<http://anonscm.debian.org/cgit/collab-maint/openvpn.git/tree/debian/openvpn.service>
  [4] 
<http://anonscm.debian.org/cgit/collab-maint/openvpn.git/tree/debian/openvpn@.service>
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to