SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I didn't have to research systemd dependent software before, but I was implementing Zabbix monitoring system on our office network and noticed their new agent2 requires systemd.
I don't need agent2 on Slackware right now, I'm using it as Zabbix server and it is virtual machine anyway, but probably I'll need it at some point. I was looking at agent2 because it has build-in solution for hdd/ssd SMART monitoring, and who knows, maybe Zabbix will drop support for agent1 in the future.
So the question for now is in general. Is it possible to run systemd required services on Slackware? Any workaround would be ok too, just need to know if it's possible to work with such software if necessary, before I choose software and OS for office monitoring system.
While Slackware includes a few systemd services in /usr/lib/systemd (I assume not used by default but as shipped by upstream), the issue could more likely be the lack of libsystemd. Just a guess as I did not dig into agent2 to check.
I didn't have to research systemd dependent software before, but I was implementing Zabbix monitoring system on our office network and noticed their new agent2 requires systemd.
I don't need agent2 on Slackware right now, I'm using it as Zabbix server and it is virtual machine anyway, but probably I'll need it at some point. I was looking at agent2 because it has build-in solution for hdd/ssd SMART monitoring, and who knows, maybe Zabbix will drop support for agent1 in the future.
So the question for now is in general. Is it possible to run systemd required services on Slackware? Any workaround would be ok too, just need to know if it's possible to work with such software if necessary, before I choose software and OS for office monitoring system.
Thanks in advance!
Did you find a good solution? Looking to create slackbuilds package for agent2, but did not yet investigate in more details.
So the question for now is in general. Is it possible to run systemd required services on Slackware? Any workaround would be ok too, just need to know if it's possible to work with such software if necessary, before I choose software and OS for office monitoring system.
Thanks in advance!
Have you tried to use dlackware ? Bart was working on getting Slackware with systemd but I dont have idea if he is still on it.
See here: https://github.com/Dlackware/systemd
I think the question here is not that much about systemd itself, more about how to run the specific service.
Upstream packages rely on systemd.
I uploaded a simple version of it to slackbuilds, please check and let me know if that works for you.
Let me just understand, service files are run by systemd daemon isnt it ? They are called by the service, but then you should have the daemon to enable it or run it.
Or do I get whole that SysD thingy wrong ?
The application runs in the foreground... or background, but doesn't daemonize. So systemd handles that.
If you just start it normally, it runs as root, as it also doesn't switch user. systemd unit is also configured to run it with correct user.
AFAIK those are the main problems with it.
But rc script with this seems to do the trick:
su -s /bin/sh -c "/usr/sbin/zabbix_agent2 >> /var/log/zabbix/zabbix_agent2.log 2>&1 &" zabbixagent
The application runs in the foreground... or background, but doesn't daemonize. So systemd handles that.
If you just start it normally, it runs as root, as it also doesn't switch user. systemd unit is also configured to run it with correct user.
AFAIK those are the main problems with it.
But rc script with this seems to do the trick:
su -s /bin/sh -c "/usr/sbin/zabbix_agent2 >> /var/log/zabbix/zabbix_agent2.log 2>&1 &" zabbixagent
I suggest looking at "setpriv" as a better way to run a process as another user, e.g.,
Another solution would be using a proper process supervisor to run the zabbix_agent2 daemon. Slackware ships "daemon" by default, which features uid/gid changing and stdout/stderr forwarding to syslog.
Last edited by mumahendras3; 03-17-2024 at 09:19 AM.
Reason: Minor formatting and grammar fixes
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.