Hi,
instead of adding systemd code to ipmitool, I tried to find out what is
really wrong with impievd so systemd cannot start it. It's quite
difficult to debug systemd and a daemon together, but finally I got results.
It turns out that the ipmievd does not fork() at all if it is started
under PID=1. That was the last thing I would expect :), that's why it
took so much time, I was looking for bugs elsewhere.
Attached you can find another patch, now it's very simple and without
any copyright notices.
Is there any other init system, which starts service with parent PID=1?
I.e. does the patch break anything?
Jan
commit 00576a015de3aacd8326b0a5641d0db331b588e6
Author: Jan Safranek <jsafr...@redhat.com>
Date: Mon Aug 13 14:35:28 2012 +0200
Fixed ipmievd start under systemd.
Systemd init system starts services with parent PID=1. Still, it is expected
that the daemon forks and exits with nozero exit status, if its initialization
fails.
diff --git a/lib/helper.c b/lib/helper.c
index 9db693a..bc9fa84 100644
--- a/lib/helper.c
+++ b/lib/helper.c
@@ -549,10 +549,6 @@ ipmi_start_daemon(struct ipmi_intf *intf)
sigset_t sighup;
#endif
- /* if we are started from init no need to become daemon */
- if (getppid() == 1)
- return;
-
#ifdef SIGHUP
sigemptyset(&sighup);
sigaddset(&sighup, SIGHUP);
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel