You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IPwatchD 1.2.1 released back in 2011 was designed with "System V" init system in mind. As of 2018, the majority of Linux distributions (including Debian, Ubuntu, Fedora, CentOS and RHEL) have adopted systemd as their default init system so adapting IPwatchD to systemd seems to be inevitable.
Fedora package already includes following patch which adds basic systemd support:
diff -uNr ipwatchd-1.2.1/src/daemonize.c ipwatchd-1.2.1-systemd/src/daemonize.c--- ipwatchd-1.2.1/src/daemonize.c 2011-07-24 16:39:03.000000000 +0200+++ ipwatchd-1.2.1-systemd/src/daemonize.c 2013-10-09 14:17:19.381133164 +0200@@ -41,12 +41,13 @@
return (IPWD_RV_ERROR);
}
- /* If parent of this process is init we are already in daemon mode */- if (getppid () == 1)- {- ipwd_message (IPWD_MSG_TYPE_INFO, "Already running as daemon");- return (IPWD_RV_SUCCESS);- }+ // Commented out so systemd can treat ipwatchd as "forking" service+ ///* If parent of this process is init we are already in daemon mode */+ //if (getppid () == 1)+ //{+ // ipwd_message (IPWD_MSG_TYPE_INFO, "Already running as daemon");+ // return (IPWD_RV_SUCCESS);+ //}
/* Fork child process */
pid_t pid = fork ();
diff -uNr ipwatchd-1.2.1/src/ipwatchd.service ipwatchd-1.2.1-systemd/src/ipwatchd.service--- ipwatchd-1.2.1/src/ipwatchd.service 1970-01-01 01:00:00.000000000 +0100+++ ipwatchd-1.2.1-systemd/src/ipwatchd.service 2013-10-09 14:17:41.919028973 +0200@@ -0,0 +1,10 @@+[Unit]+Description=IP conflict detection daemon+After=syslog.target network.target++[Service]+Type=forking+ExecStart=/usr/sbin/ipwatchd -c /etc/ipwatchd.conf++[Install]+WantedBy=multi-user.targetdiff -uNr ipwatchd-1.2.1/src/Makefile ipwatchd-1.2.1-systemd/src/Makefile--- ipwatchd-1.2.1/src/Makefile 2011-07-24 16:39:03.000000000 +0200+++ ipwatchd-1.2.1-systemd/src/Makefile 2013-10-09 14:12:29.492616767 +0200@@ -43,14 +43,15 @@
install:
- mkdir -p $(DESTDIR)/etc/init.d+ mkdir -p $(DESTDIR)/etc+ mkdir -p $(DESTDIR)/usr/lib/systemd/system
mkdir -p $(DESTDIR)/usr/sbin
mkdir -p $(DESTDIR)/usr/share/man/man8
mkdir -p $(DESTDIR)/usr/share/man/man5
mkdir -p $(DESTDIR)/usr/share/man/man1
cp ipwatchd $(DESTDIR)/usr/sbin
cp scripts/ipwatchd-script $(DESTDIR)/usr/sbin
- cp scripts/ipwatchd $(DESTDIR)/etc/init.d+ cp ipwatchd.service $(DESTDIR)/usr/lib/systemd/system/
cp ipwatchd.conf $(DESTDIR)/etc
cp ../doc/ipwatchd.8.gz $(DESTDIR)/usr/share/man/man8
cp ../doc/ipwatchd.conf.5.gz $(DESTDIR)/usr/share/man/man5
@@ -59,7 +60,7 @@
uninstall:
rm $(DESTDIR)/usr/sbin/ipwatchd
rm $(DESTDIR)/usr/sbin/ipwatchd-script
- rm $(DESTDIR)/etc/init.d/ipwatchd+ rm $(DESTDIR)/usr/lib/systemd/system/ipwatchd.service
rm $(DESTDIR)/etc/ipwatchd.conf
rm $(DESTDIR)/usr/share/man/man8/ipwatchd.8.gz
rm $(DESTDIR)/usr/share/man/man5/ipwatchd.conf.5.gz
The text was updated successfully, but these errors were encountered:
IPwatchD 1.2.1 released back in 2011 was designed with "System V" init system in mind. As of 2018, the majority of Linux distributions (including Debian, Ubuntu, Fedora, CentOS and RHEL) have adopted systemd as their default init system so adapting IPwatchD to systemd seems to be inevitable.
Fedora package already includes following patch which adds basic systemd support:
The text was updated successfully, but these errors were encountered: