Hello, I have 2 stunnel instance on a server and I have to insert all 2 in systemd. How to do that? Is it possible to create 2 stunnel.service naming different, for example stunnel.service and stunnel1.service where insert the script to start at boot of the machine?
Thanks a lot for you help,
Bye Simona
On Tue, Mar 02, 2021 at 12:14:08PM +0100, simona vittori wrote:
Hello, I have 2 stunnel instance on a server and I have to insert all 2 in systemd. How to do that? Is it possible to create 2 stunnel.service naming different, for example stunnel.service and stunnel1.service where insert the script to start at boot of the machine?
Recently I made a change to the Debian stunnel package that introduced the stunnel@.service instanced units at both system- and user-level. Can you try placing the two attached files - stunnel@.service and stunnel.target - into the /etc/systemd/system/ directory, running `systemctl daemon-reload`, and then starting and, if it works, enabling 'stunnel@somename.service', where 'somename' is the name of an /etc/stunnel/somename.conf file? This allows you a bit more fine-grained control: put several definitions in several config files in the /etc/stunnel/ directory, only enable some of them at boot time, start and stop others as needed.
Also attached is an stunnel@.user.service file that should be installed as stunnel@.service in the /etc/systemd/user/ directory; it allows a user to start their own instances of stunnel, configured via files in the ~/.config/stunnel/ directory.
Of course, the /etc/systemd/system/ and /etc/systemd/user/ paths above are meant to represent systemd unit files installed by hand by a sysadmin on a particular server; if these are installed by some kind of package, they should be placed in other directories.
I'd be very glad for any feedback.
G'luck, Peter
On Tue, Mar 02, 2021 at 01:33:28PM +0200, Peter Pentchev wrote:
On Tue, Mar 02, 2021 at 12:14:08PM +0100, simona vittori wrote:
Hello, I have 2 stunnel instance on a server and I have to insert all 2 in systemd. How to do that? Is it possible to create 2 stunnel.service naming different, for example stunnel.service and stunnel1.service where insert the script to start at boot of the machine?
Recently I made a change to the Debian stunnel package that introduced the stunnel@.service instanced units at both system- and user-level. Can you try placing the two attached files - stunnel@.service and stunnel.target - into the /etc/systemd/system/ directory, running `systemctl daemon-reload`, and then starting and, if it works, enabling 'stunnel@somename.service', where 'somename' is the name of an /etc/stunnel/somename.conf file? This allows you a bit more fine-grained control: put several definitions in several config files in the /etc/stunnel/ directory, only enable some of them at boot time, start and stop others as needed.
Ahh... I forgot to mention that in order for this to work as a Type=simple systemd service, the stunnel configuration ought to set `foreground = yes`.
G'luck, Peter