My first foray into sustemd
Well not exactly. I have done a couple of monkey see, monkey copy, monkey paste systemd adjustments :o This time I am attempting to configure stunnel to start automatically. It is installed and works if I issue the command
Quote:
Code:
[Unit] Code:
[root@taylor19 Desktop]# service stunnel start TIA Ken |
To start a service at boot, you must "enable" it. "start" merely starts it in the current session. The command you need is systemctl enable tunnel.service.
It is also bad practice to put your service file on /usr/lib. That location is for service files that come as part of a package and are liable to be updated without warning. Anything custom-made should go in /etc/systemd/system. |
Thank you hazel,
I was close. I know that "start" only works in the current session. I was using it simply to see if my stunnel.service file would fire. The "enable" step was what I was missing. Thank you for the tip on where to place the file. I noticed that all of the .system files currently reside in /usr/lib/systemd/service/ and are linked from /etc/systemd/system/ I will remember to place home made .system files in the /etc/ side of the house. I removed the link, put the file in /etc/systemd/system and issued the enable command. After a reboot I observed that stunnel was still not running. In examining the logs I found Code:
Jan 29 10:08:50 taylor19 systemd: [/usr/lib/systemd/system/stunnel.service:10] Executable path is not absolute, ignoring: kill -9 $(pgrep stunnel) I found another example stunnel.service file. Let me try it and see what happens. Thanks again, Ken |
Page 2 as Paul Harvey used to say - and now for the rest of the story...
It appears that my first sample .service file was missing the [Install] section. I replaced my file with this Code:
[Unit] Code:
[root@taylor19 system]# systemctl enable stunnel.service Thank you again for your assistance. Ken p.s. Looking at it again, the original was NOT missing the [Install] section, but it was different. At least I now have a working and non working example. I will do some investigation line by line and see what I can learn. :study: |
after installing/starting/enabling a new service, i always check with
Code:
systemctl status *****.service |
Thanks ondoho,
In this case I tested stunnel by running the program which needed it. I will keep that more generic approach in mind. Ken |
All times are GMT -5. The time now is 08:33 AM. |