Added Systemd unit files for netxmsd and nxagentd. Fixes #NX1226
authorEriks Jenkevics <eriks@netxms.org>
Mon, 3 Apr 2017 13:47:09 +0000 (16:47 +0300)
committerEriks Jenkevics <eriks@netxms.org>
Tue, 4 Apr 2017 08:21:14 +0000 (11:21 +0300)
.gitignore
configure.ac
contrib/startup/Makefile.am
contrib/startup/systemd/Makefile.am [new file with mode: 0644]
contrib/startup/systemd/README [moved from contrib/startup/archlinux/README with 100% similarity]
contrib/startup/systemd/netxmsd.in [new file with mode: 0644]
contrib/startup/systemd/nxagentd.in [moved from contrib/startup/archlinux/nxagentd.service with 63% similarity]

index e1f5d6e..d60a675 100644 (file)
@@ -15,6 +15,7 @@
 *.opt
 *.plg
 *.rej
+*.service
 *.suo
 *.res
 *.vcproj.*.user
index 2899ee8..2ba6350 100644 (file)
@@ -3352,6 +3352,7 @@ AC_CONFIG_FILES([
        contrib/mibs/Makefile
        contrib/music/Makefile
        contrib/startup/Makefile
+       contrib/startup/systemd/Makefile
        contrib/startup/debian/Makefile
        contrib/startup/gentoo/Makefile
        contrib/startup/hp-ux/Makefile
index 9e9220d..281cdee 100644 (file)
@@ -9,4 +9,4 @@
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 
-SUBDIRS = debian gentoo hp-ux redhat suse ubuntu solaris
+SUBDIRS = debian gentoo hp-ux redhat suse systemd ubuntu solaris
diff --git a/contrib/startup/systemd/Makefile.am b/contrib/startup/systemd/Makefile.am
new file mode 100644 (file)
index 0000000..a711fe9
--- /dev/null
@@ -0,0 +1,31 @@
+# Copyright (C) 2003-2017 Raden Solutions
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+EXTRA_DIST = netxmsd.in nxagentd.in
+
+REPLACE_CMD = sed "s,~BINDIR~,$(bindir),g" < $@.in | \
+    sed "s,~LIBDIR~,$(libdir),g" > $@.service
+
+all: netxmsd nxagentd
+
+netxmsd: netxmsd.in
+       $(REPLACE_CMD)
+
+nxagentd: nxagentd.in
+       $(REPLACE_CMD)
+
+clean-local:
+       rm -f netxmsd.service nxagentd.service
diff --git a/contrib/startup/systemd/netxmsd.in b/contrib/startup/systemd/netxmsd.in
new file mode 100644 (file)
index 0000000..94521b5
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=NetXMS Server
+
+[Service]
+Type=forking
+ExecStart=~BINDIR~/netxmsd -d
+PIDFile=/var/run/netxmsd.pid
+
+[Install]
+WantedBy=multi-user.target
similarity index 63%
rename from contrib/startup/archlinux/nxagentd.service
rename to contrib/startup/systemd/nxagentd.in
index 9da0b1e..e19094a 100644 (file)
@@ -3,7 +3,7 @@ Description=NetXMS Agent
 
 [Service]
 Type=forking
-ExecStart=/opt/netxms/bin/nxagentd -c /opt/netxms/etc/nxagentd.conf -d
+ExecStart=~BINDIR~/nxagentd -d
 PIDFile=/var/run/nxagentd.pid
 
 [Install]