I’m trying to get my systemd bitlbee script to start, I can successfully run it manually but it doesn’t startup on boot.
The process does run on boot, but it does not load the correct config file I want to run it with:
I created both the user and group - bitlbee and when I run it manually it does run as the bitlbee user.
I don’t wanna use the osmc user/group for security reasons.
Is there any way I can debug my script?
Systemd seems to provide little info when the service is dead.
I have already uncommented that line.
I changed the service to start as osmc and it still runs under bitlbee which is what I want.
But, the service does not load the /etc/bitlbee/bitlbee.conf configuration file that I’m running as an option.
It currently loads with the /usr/local/sbin/bitlbee -I option, which does not include the file above.
Without it, my settings aren’t loaded and I can’t even kill that PID process unless I kill it under sudo -s.
sudo chmod 0644 /usr/lib/systemd/system/bitlbee.service returns: chmod: cannot access '/usr/lib/systemd/system/bitlbee.service': No such file or directory
Also, running the systemd unit file without the user & group still does not load the service:
The usual location for the bitlbee.service file should be in /lib/systemd/system. Service files are configuration data and are therefore not executable.
When you enable / disable the service using systemctl what happens is that systemd will make / remove a symbolic link somewhere under /etc/systemd/system. Since the [Install] section says WantedBy=multi-user.target, the symbolic link will be created in /etc/systemd/system/multi-user.target.wants.
As Tom_Doyle rightly says, if you change anything in the bitlbee.service file, you need to run sudo systemctl daemon-reload for it to be picked up by systemd.
I’ve had a play with this out of curiosity, and it seems the maintainer for package is providing an init.d script, which is compatible with the systemd sysv init compatibility mode.
I would try this:
sudo systemctl disable bitlbee.service #This should remove the symlink /etc/systemd/system/bitlbee.service
sudo rm /lib/systemd/system/bitlbee.service #not required for sysv init compatibility mode.
sudo systemctl daemon-reload
sudo systemctl enable bitlbee #If you do not receive a prompt confirming the service has been enabled, then please reinstall bitlbee & bitlbee-common
sudo systemctl start bitlbee.
Confirm bitlbee has started as expected, if so restart osmc and confirm if starting as required.
@dillthedog good spot on /lib/systemd/system, copy paste error.
After modifying the systemd fedora unit you provided, the service still runs as /usr/local/sbin/bitlbee -I. If I run it manually, it works well but I still have to kill the PID created on boot to run the fork with the configuration file that I need.
Apologies I’d forgotten about the folder structure difference between fedora & debian, could you please post the modified bitlbee.service.
Also Can you please confirm you are saving the bitlbee.service to /lib/systemd/system and running sudo systemctl daemon-reload, as dillthedog pointed out yesterday.
Also I seen a link yesterday that you can compile bitlbee with systemd support, which I assume creates the correct systemd unit file. I can’t find the link at the moment, please standby.
I do run systemctl daemon-reload every time I make changes to the unit.
On boot, the same root bitlbee process always runs as: /usr/local/sbin/bitlbee -I