* [bug#39329] [PATCH 0/2] Start guix-daemon in SysV.
@ 2020-01-28 15:55 Danny Milosavljevic
2020-01-28 15:58 ` [bug#39329] [PATCH 1/2] Add system start-up files for guix-daemon Danny Milosavljevic
` (3 more replies)
0 siblings, 4 replies; 19+ messages in thread
From: Danny Milosavljevic @ 2020-01-28 15:55 UTC (permalink / raw)
To: 39329; +Cc: Danny Milosavljevic
Danny Milosavljevic (2):
Add system start-up files for guix-daemon.
guix-install.sh: Install sysv init script.
.gitignore | 1 +
etc/guix-install.sh | 11 +++++
etc/init.d/guix-daemon.in | 88 +++++++++++++++++++++++++++++++++++++++
nix/local.mk | 16 ++++++-
4 files changed, 114 insertions(+), 2 deletions(-)
create mode 100644 etc/init.d/guix-daemon.in
^ permalink raw reply [flat|nested] 19+ messages in thread
* [bug#39329] [PATCH 1/2] Add system start-up files for guix-daemon.
2020-01-28 15:55 [bug#39329] [PATCH 0/2] Start guix-daemon in SysV Danny Milosavljevic
@ 2020-01-28 15:58 ` Danny Milosavljevic
2020-01-28 15:59 ` [bug#39329] [PATCH 2/2] guix-install.sh: Install sysv init script Danny Milosavljevic
2020-01-28 16:01 ` [bug#39329] [PATCH 1/2] Add system start-up files for guix-daemon Danny Milosavljevic
2020-01-28 16:29 ` [bug#39329] [PATCH v3 0/2] Start guix-daemon on SysV Danny Milosavljevic
` (2 subsequent siblings)
3 siblings, 2 replies; 19+ messages in thread
From: Danny Milosavljevic @ 2020-01-28 15:58 UTC (permalink / raw)
To: 39329; +Cc: Danny Milosavljevic
* etc/init.d/guix-daemon.in: New file.
* nix/local.mk (etc/init.d/guix-daemon): New rule.
(nodist_sysvinitservice_DATA): Add etc/init.d/guix-daemon.in .
(CLEANFILES): Add etc/init.d/guix-daemon .
* .gitignore: Add etc/init.d/guix-daemon .
---
.gitignore | 1 +
etc/init.d/guix-daemon.in | 88 +++++++++++++++++++++++++++++++++++++++
nix/local.mk | 16 ++++++-
3 files changed, 103 insertions(+), 2 deletions(-)
create mode 100644 etc/init.d/guix-daemon.in
diff --git a/.gitignore b/.gitignore
index df59a9176e..de058dda5e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -71,6 +71,7 @@
/etc/guix-daemon.service
/etc/guix-publish.conf
/etc/guix-publish.service
+/etc/init.d/guix-daemon
/guix-daemon
/guix/config.scm
/libformat.a
diff --git a/etc/init.d/guix-daemon.in b/etc/init.d/guix-daemon.in
new file mode 100644
index 0000000000..8974a5d215
--- /dev/null
+++ b/etc/init.d/guix-daemon.in
@@ -0,0 +1,88 @@
+#!/bin/bash
+### BEGIN INIT INFO
+# Provides: guix-daemon
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Guix build daemon
+# Description: Provides a daemon that does builds for Guix
+### END INIT INFO
+
+set -e
+set -o pipefail
+mkdir -p "/var/run"
+if [ ! -f "@localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon" ]
+then
+ exit 5
+fi
+
+case "$1" in
+start)
+ if [ -f "/var/run/guix-daemon.pid" ]
+ then
+ pid="`cat /var/run/guix-daemon.pid`"
+ if ps www "${pid}" |grep -qa guix-daemon
+ then
+ exit 0
+ else
+ echo "guix-daemon has a stale pid file" >&2
+ exit 1
+ fi
+ else
+ daemonize \
+ -a \
+ -e /var/log/guix-daemon-stderr.log \
+ -o /var/log/guix-daemon-stdout.log \
+ -E GUIX_LOCPATH=@localstatedir@/guix/profiles/per-user/root/guix-profile/lib/locale \
+ -E LC_ALL=en_US.utf8 \
+ -p /var/run/guix-daemon.pid \
+ @localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon \
+ --build-users-group=guixbuild
+ fi
+ ;;
+stop)
+ if [ -f "/var/run/guix-daemon.pid" ]
+ then
+ pid="`cat /var/run/guix-daemon.pid`"
+ if ps www "${pid}" |grep -qa guix-daemon
+ then
+ kill "${pid}"
+ sleep 10
+ kill -9 "${pid}" || true
+ exit 0
+ else
+ echo "guix-daemon has a stale pid file" >&2
+ exit 1
+ fi
+ else
+ exit 0
+ fi
+ ;;
+status)
+ if [ -f "/var/run/guix-daemon.pid" ]
+ then
+ pid="`cat /var/run/guix-daemon.pid`"
+ if ps www "${pid}" |grep -qa guix-daemon
+ then
+ echo "guix-daemon is running"
+ exit 0
+ else
+ echo "guix-daemon has a stale pid file"
+ exit 1
+ fi
+ else
+ echo "guix-daemon is not running"
+ exit 3
+ fi
+ ;;
+restart)
+force-reload)
+ "$0" stop
+ "$0" start
+ ;;
+*)
+ echo "Usage: $0 (start|stop|status|restart|force-reload)"
+ exit 3
+ ;;
+esac
diff --git a/nix/local.mk b/nix/local.mk
index dc5a8398b2..a64bdd2137 100644
--- a/nix/local.mk
+++ b/nix/local.mk
@@ -164,6 +164,16 @@ etc/guix-%.service: etc/guix-%.service.in \
"$<" > "$@.tmp"; \
mv "$@.tmp" "$@"
+sysvinitservicedir = $(sysconfdir)/init.d
+nodist_sysvinitservice_DATA = etc/init.d/guix-daemon
+
+etc/init.d/guix-daemon: etc/init.d/guix-daemon.in \
+ $(top_builddir)/config.status
+ $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \
+ $(SED) -e 's|@''localstatedir''@|$(localstatedir)|' < \
+ "$<" > "$@.tmp"; \
+ mv "$@.tmp" "$@"
+
# The '.conf' jobs for Upstart.
upstartjobdir = $(libdir)/upstart/system
nodist_upstartjob_DATA = etc/guix-daemon.conf etc/guix-publish.conf
@@ -177,7 +187,8 @@ etc/guix-%.conf: etc/guix-%.conf.in \
CLEANFILES += \
$(nodist_systemdservice_DATA) \
- $(nodist_upstartjob_DATA)
+ $(nodist_upstartjob_DATA) \
+ $(nodist_sysvinitservice_DATA)
EXTRA_DIST += \
%D%/AUTHORS \
@@ -185,7 +196,8 @@ EXTRA_DIST += \
etc/guix-daemon.service.in \
etc/guix-daemon.conf.in \
etc/guix-publish.service.in \
- etc/guix-publish.conf.in
+ etc/guix-publish.conf.in \
+ etc/init.d/guix-daemon.in
if CAN_RUN_TESTS
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [bug#39329] [PATCH 2/2] guix-install.sh: Install sysv init script.
2020-01-28 15:58 ` [bug#39329] [PATCH 1/2] Add system start-up files for guix-daemon Danny Milosavljevic
@ 2020-01-28 15:59 ` Danny Milosavljevic
2020-01-28 16:01 ` Danny Milosavljevic
2020-01-28 16:01 ` [bug#39329] [PATCH 1/2] Add system start-up files for guix-daemon Danny Milosavljevic
1 sibling, 1 reply; 19+ messages in thread
From: Danny Milosavljevic @ 2020-01-28 15:59 UTC (permalink / raw)
To: 39329; +Cc: Danny Milosavljevic
* etc/guix-install.sh (sys_enable_guix_daemon): Install sysv init script.
---
etc/guix-install.sh | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index bfd3842933..f3ea1def32 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -361,6 +361,17 @@ sys_enable_guix_daemon()
systemctl enable guix-daemon; } &&
_msg "${PAS}enabled Guix daemon via systemd"
;;
+ sysv-init)
+ { mkdir -p /etc/init.d;
+ cp "${ROOT_HOME}/.config/guix/current/etc/init.d/guix-daemon" \
+ /etc/init.d/guix-daemon;
+ chmod 664 /etc/init.d/guix-daemon;
+
+ update-rc.d guix-daemon defaults &&
+ update-rc.d guix-daemon enable &&
+ service guix-daemon start; } &&
+ _msg "${PAS}enabled Guix daemon via sysv"
+ ;;
NA|*)
_msg "${ERR}unsupported init system; run the daemon manually:"
echo " ${ROOT_HOME}/.config/guix/current/bin/guix-daemon --build-users-group=guixbuild"
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [bug#39329] [PATCH 2/2] guix-install.sh: Install sysv init script.
2020-01-28 15:59 ` [bug#39329] [PATCH 2/2] guix-install.sh: Install sysv init script Danny Milosavljevic
@ 2020-01-28 16:01 ` Danny Milosavljevic
0 siblings, 0 replies; 19+ messages in thread
From: Danny Milosavljevic @ 2020-01-28 16:01 UTC (permalink / raw)
To: 39329
[-- Attachment #1: Type: text/plain, Size: 60 bytes --]
> + chmod 664 /etc/init.d/guix-daemon;
775
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* [bug#39329] [PATCH 1/2] Add system start-up files for guix-daemon.
2020-01-28 15:58 ` [bug#39329] [PATCH 1/2] Add system start-up files for guix-daemon Danny Milosavljevic
2020-01-28 15:59 ` [bug#39329] [PATCH 2/2] guix-install.sh: Install sysv init script Danny Milosavljevic
@ 2020-01-28 16:01 ` Danny Milosavljevic
1 sibling, 0 replies; 19+ messages in thread
From: Danny Milosavljevic @ 2020-01-28 16:01 UTC (permalink / raw)
To: 39329
[-- Attachment #1: Type: text/plain, Size: 204 bytes --]
On Tue, 28 Jan 2020 16:58:59 +0100
Danny Milosavljevic <dannym@scratchpost.org> wrote:
> + if ps www "${pid}" |grep -qa guix-daemon
If pgrep is standard enough, might want to use that. Is it?
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* [bug#39329] [PATCH v3 0/2] Start guix-daemon on SysV.
2020-01-28 15:55 [bug#39329] [PATCH 0/2] Start guix-daemon in SysV Danny Milosavljevic
2020-01-28 15:58 ` [bug#39329] [PATCH 1/2] Add system start-up files for guix-daemon Danny Milosavljevic
@ 2020-01-28 16:29 ` Danny Milosavljevic
2020-01-28 16:29 ` [bug#39329] [PATCH v3 1/2] Add system start-up files for guix-daemon Danny Milosavljevic
2020-01-28 16:29 ` [bug#39329] [PATCH v3 2/2] guix-install.sh: Install sysv init script Danny Milosavljevic
2020-01-28 17:38 ` [bug#39329] [PATCH v4 0/2] Start guix-daemon on SysV Danny Milosavljevic
2020-04-13 17:02 ` Vincent Legoll
3 siblings, 2 replies; 19+ messages in thread
From: Danny Milosavljevic @ 2020-01-28 16:29 UTC (permalink / raw)
To: 39329; +Cc: Danny Milosavljevic
Danny Milosavljevic (2):
Add system start-up files for guix-daemon.
guix-install.sh: Install sysv init script.
.gitignore | 1 +
etc/guix-install.sh | 11 ++++++
etc/init.d/guix-daemon.in | 80 +++++++++++++++++++++++++++++++++++++++
nix/local.mk | 16 +++++++-
4 files changed, 106 insertions(+), 2 deletions(-)
create mode 100644 etc/init.d/guix-daemon.in
^ permalink raw reply [flat|nested] 19+ messages in thread
* [bug#39329] [PATCH v3 1/2] Add system start-up files for guix-daemon.
2020-01-28 16:29 ` [bug#39329] [PATCH v3 0/2] Start guix-daemon on SysV Danny Milosavljevic
@ 2020-01-28 16:29 ` Danny Milosavljevic
2020-01-28 16:29 ` [bug#39329] [PATCH v3 2/2] guix-install.sh: Install sysv init script Danny Milosavljevic
1 sibling, 0 replies; 19+ messages in thread
From: Danny Milosavljevic @ 2020-01-28 16:29 UTC (permalink / raw)
To: 39329; +Cc: Danny Milosavljevic
* etc/init.d/guix-daemon.in: New file.
* nix/local.mk (etc/init.d/guix-daemon): New rule.
(nodist_sysvinitservice_DATA): Add etc/init.d/guix-daemon.in .
(CLEANFILES): Add etc/init.d/guix-daemon .
* .gitignore: Add etc/init.d/guix-daemon .
---
.gitignore | 1 +
etc/init.d/guix-daemon.in | 80 +++++++++++++++++++++++++++++++++++++++
nix/local.mk | 16 +++++++-
3 files changed, 95 insertions(+), 2 deletions(-)
create mode 100644 etc/init.d/guix-daemon.in
diff --git a/.gitignore b/.gitignore
index df59a9176e..de058dda5e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -71,6 +71,7 @@
/etc/guix-daemon.service
/etc/guix-publish.conf
/etc/guix-publish.service
+/etc/init.d/guix-daemon
/guix-daemon
/guix/config.scm
/libformat.a
diff --git a/etc/init.d/guix-daemon.in b/etc/init.d/guix-daemon.in
new file mode 100644
index 0000000000..b9c99204df
--- /dev/null
+++ b/etc/init.d/guix-daemon.in
@@ -0,0 +1,80 @@
+#!/bin/bash
+### BEGIN INIT INFO
+# Provides: guix-daemon
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Guix build daemon
+# Description: Provides a daemon that does builds for Guix
+### END INIT INFO
+
+set -e
+mkdir -p "/var/run"
+if [ ! -f "@localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon" ]
+then
+ exit 5
+fi
+
+case "$1" in
+start)
+ if [ -f "/var/run/guix-daemon.pid" ]
+ then
+ if pgrep -F "/var/run/guix-daemon.pid" guix-daemon
+ then
+ exit 0
+ else
+ echo "guix-daemon has a stale pid file" >&2
+ exit 1
+ fi
+ else
+ daemonize \
+ -a \
+ -e "/var/log/guix-daemon-stderr.log" \
+ -o "/var/log/guix-daemon-stdout.log" \
+ -E GUIX_LOCPATH=@localstatedir@/guix/profiles/per-user/root/guix-profile/lib/locale \
+ -E LC_ALL=en_US.utf8 \
+ -p "/var/run/guix-daemon.pid" \
+ @localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon \
+ --build-users-group=guixbuild
+ fi
+ ;;
+stop)
+ if [ -f "/var/run/guix-daemon.pid" ]
+ then
+ pkill -F "/var/run/guix-daemon.pid" guix-daemon || {
+ exit 1
+ }
+ sleep 10
+ pkill --signal 9 -F "/var/run/guix-daemon.pid" guix-daemon || true
+ exit 0
+ else
+ exit 0
+ fi
+ ;;
+status)
+ if [ -f "/var/run/guix-daemon.pid" ]
+ then
+ if pgrep -F "/var/run/guix-daemon.pid" guix-daemon
+ then
+ echo "guix-daemon is running"
+ exit 0
+ else
+ echo "guix-daemon has a stale pid file"
+ exit 1
+ fi
+ else
+ echo "guix-daemon is not running"
+ exit 3
+ fi
+ ;;
+restart)
+force-reload)
+ "$0" stop
+ "$0" start
+ ;;
+*)
+ echo "Usage: $0 (start|stop|status|restart|force-reload)"
+ exit 3
+ ;;
+esac
diff --git a/nix/local.mk b/nix/local.mk
index dc5a8398b2..a64bdd2137 100644
--- a/nix/local.mk
+++ b/nix/local.mk
@@ -164,6 +164,16 @@ etc/guix-%.service: etc/guix-%.service.in \
"$<" > "$@.tmp"; \
mv "$@.tmp" "$@"
+sysvinitservicedir = $(sysconfdir)/init.d
+nodist_sysvinitservice_DATA = etc/init.d/guix-daemon
+
+etc/init.d/guix-daemon: etc/init.d/guix-daemon.in \
+ $(top_builddir)/config.status
+ $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \
+ $(SED) -e 's|@''localstatedir''@|$(localstatedir)|' < \
+ "$<" > "$@.tmp"; \
+ mv "$@.tmp" "$@"
+
# The '.conf' jobs for Upstart.
upstartjobdir = $(libdir)/upstart/system
nodist_upstartjob_DATA = etc/guix-daemon.conf etc/guix-publish.conf
@@ -177,7 +187,8 @@ etc/guix-%.conf: etc/guix-%.conf.in \
CLEANFILES += \
$(nodist_systemdservice_DATA) \
- $(nodist_upstartjob_DATA)
+ $(nodist_upstartjob_DATA) \
+ $(nodist_sysvinitservice_DATA)
EXTRA_DIST += \
%D%/AUTHORS \
@@ -185,7 +196,8 @@ EXTRA_DIST += \
etc/guix-daemon.service.in \
etc/guix-daemon.conf.in \
etc/guix-publish.service.in \
- etc/guix-publish.conf.in
+ etc/guix-publish.conf.in \
+ etc/init.d/guix-daemon.in
if CAN_RUN_TESTS
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [bug#39329] [PATCH v3 2/2] guix-install.sh: Install sysv init script.
2020-01-28 16:29 ` [bug#39329] [PATCH v3 0/2] Start guix-daemon on SysV Danny Milosavljevic
2020-01-28 16:29 ` [bug#39329] [PATCH v3 1/2] Add system start-up files for guix-daemon Danny Milosavljevic
@ 2020-01-28 16:29 ` Danny Milosavljevic
1 sibling, 0 replies; 19+ messages in thread
From: Danny Milosavljevic @ 2020-01-28 16:29 UTC (permalink / raw)
To: 39329; +Cc: Danny Milosavljevic
* etc/guix-install.sh (sys_enable_guix_daemon): Install sysv init script.
---
etc/guix-install.sh | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index bfd3842933..e7f4d2cd59 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -361,6 +361,17 @@ sys_enable_guix_daemon()
systemctl enable guix-daemon; } &&
_msg "${PAS}enabled Guix daemon via systemd"
;;
+ sysv-init)
+ { mkdir -p /etc/init.d;
+ cp "${ROOT_HOME}/.config/guix/current/etc/init.d/guix-daemon" \
+ /etc/init.d/guix-daemon;
+ chmod 775 /etc/init.d/guix-daemon;
+
+ update-rc.d guix-daemon defaults &&
+ update-rc.d guix-daemon enable &&
+ service guix-daemon start; } &&
+ _msg "${PAS}enabled Guix daemon via sysv"
+ ;;
NA|*)
_msg "${ERR}unsupported init system; run the daemon manually:"
echo " ${ROOT_HOME}/.config/guix/current/bin/guix-daemon --build-users-group=guixbuild"
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [bug#39329] [PATCH v4 0/2] Start guix-daemon on SysV.
2020-01-28 15:55 [bug#39329] [PATCH 0/2] Start guix-daemon in SysV Danny Milosavljevic
2020-01-28 15:58 ` [bug#39329] [PATCH 1/2] Add system start-up files for guix-daemon Danny Milosavljevic
2020-01-28 16:29 ` [bug#39329] [PATCH v3 0/2] Start guix-daemon on SysV Danny Milosavljevic
@ 2020-01-28 17:38 ` Danny Milosavljevic
2020-01-28 17:38 ` [bug#39329] [PATCH v4 1/2] Add system start-up files for guix-daemon Danny Milosavljevic
` (2 more replies)
2020-04-13 17:02 ` Vincent Legoll
3 siblings, 3 replies; 19+ messages in thread
From: Danny Milosavljevic @ 2020-01-28 17:38 UTC (permalink / raw)
To: 39329; +Cc: Danny Milosavljevic
Danny Milosavljevic (2):
Add system start-up files for guix-daemon.
guix-install.sh: Install SysV init script.
.gitignore | 1 +
etc/guix-install.sh | 11 ++++++
etc/init.d/guix-daemon.in | 78 +++++++++++++++++++++++++++++++++++++++
nix/local.mk | 16 +++++++-
4 files changed, 104 insertions(+), 2 deletions(-)
create mode 100644 etc/init.d/guix-daemon.in
^ permalink raw reply [flat|nested] 19+ messages in thread
* [bug#39329] [PATCH v4 1/2] Add system start-up files for guix-daemon.
2020-01-28 17:38 ` [bug#39329] [PATCH v4 0/2] Start guix-daemon on SysV Danny Milosavljevic
@ 2020-01-28 17:38 ` Danny Milosavljevic
2020-02-14 8:43 ` Ludovic Courtès
2020-01-28 17:38 ` [bug#39329] [PATCH v4 2/2] guix-install.sh: Install SysV init script Danny Milosavljevic
2020-03-11 1:49 ` [bug#39329] [PATCH v4 0/2] Start guix-daemon on SysV Danny Milosavljevic
2 siblings, 1 reply; 19+ messages in thread
From: Danny Milosavljevic @ 2020-01-28 17:38 UTC (permalink / raw)
To: 39329; +Cc: Danny Milosavljevic
* etc/init.d/guix-daemon.in: New file.
* nix/local.mk (etc/init.d/guix-daemon): New rule.
(nodist_sysvinitservice_DATA): Add etc/init.d/guix-daemon.in .
(CLEANFILES): Add etc/init.d/guix-daemon .
* .gitignore: Add etc/init.d/guix-daemon .
---
.gitignore | 1 +
etc/init.d/guix-daemon.in | 78 +++++++++++++++++++++++++++++++++++++++
nix/local.mk | 16 +++++++-
3 files changed, 93 insertions(+), 2 deletions(-)
create mode 100644 etc/init.d/guix-daemon.in
diff --git a/.gitignore b/.gitignore
index df59a9176e..de058dda5e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -71,6 +71,7 @@
/etc/guix-daemon.service
/etc/guix-publish.conf
/etc/guix-publish.service
+/etc/init.d/guix-daemon
/guix-daemon
/guix/config.scm
/libformat.a
diff --git a/etc/init.d/guix-daemon.in b/etc/init.d/guix-daemon.in
new file mode 100644
index 0000000000..80bd18eaeb
--- /dev/null
+++ b/etc/init.d/guix-daemon.in
@@ -0,0 +1,78 @@
+#!/bin/bash
+### BEGIN INIT INFO
+# Provides: guix-daemon
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Guix build daemon
+# Description: Provides a daemon that does builds for Guix
+### END INIT INFO
+
+set -e
+mkdir -p "/var/run"
+if [ ! -f "@localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon" ]
+then
+ exit 5
+fi
+
+case "$1" in
+start)
+ if [ -f "/var/run/guix-daemon.pid" ]
+ then
+ if pgrep -F "/var/run/guix-daemon.pid" guix-daemon
+ then
+ exit 0
+ else
+ echo "guix-daemon has a stale pid file" >&2
+ exit 1
+ fi
+ else
+ daemonize \
+ -a \
+ -e "/var/log/guix-daemon-stderr.log" \
+ -o "/var/log/guix-daemon-stdout.log" \
+ -E GUIX_LOCPATH=@localstatedir@/guix/profiles/per-user/root/guix-profile/lib/locale \
+ -E LC_ALL=en_US.utf8 \
+ -p "/var/run/guix-daemon.pid" \
+ @localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon \
+ --build-users-group=guixbuild
+ fi
+ ;;
+stop)
+ if [ -f "/var/run/guix-daemon.pid" ]
+ then
+ pkill -F "/var/run/guix-daemon.pid" guix-daemon || {
+ exit 1
+ }
+ exit 0
+ else
+ exit 0
+ fi
+ ;;
+status)
+ if [ -f "/var/run/guix-daemon.pid" ]
+ then
+ if pgrep -F "/var/run/guix-daemon.pid" guix-daemon
+ then
+ echo "guix-daemon is running"
+ exit 0
+ else
+ echo "guix-daemon has a stale pid file"
+ exit 1
+ fi
+ else
+ echo "guix-daemon is not running"
+ exit 3
+ fi
+ ;;
+restart)
+force-reload)
+ "$0" stop
+ "$0" start
+ ;;
+*)
+ echo "Usage: $0 (start|stop|status|restart|force-reload)"
+ exit 3
+ ;;
+esac
diff --git a/nix/local.mk b/nix/local.mk
index dc5a8398b2..a64bdd2137 100644
--- a/nix/local.mk
+++ b/nix/local.mk
@@ -164,6 +164,16 @@ etc/guix-%.service: etc/guix-%.service.in \
"$<" > "$@.tmp"; \
mv "$@.tmp" "$@"
+sysvinitservicedir = $(sysconfdir)/init.d
+nodist_sysvinitservice_DATA = etc/init.d/guix-daemon
+
+etc/init.d/guix-daemon: etc/init.d/guix-daemon.in \
+ $(top_builddir)/config.status
+ $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \
+ $(SED) -e 's|@''localstatedir''@|$(localstatedir)|' < \
+ "$<" > "$@.tmp"; \
+ mv "$@.tmp" "$@"
+
# The '.conf' jobs for Upstart.
upstartjobdir = $(libdir)/upstart/system
nodist_upstartjob_DATA = etc/guix-daemon.conf etc/guix-publish.conf
@@ -177,7 +187,8 @@ etc/guix-%.conf: etc/guix-%.conf.in \
CLEANFILES += \
$(nodist_systemdservice_DATA) \
- $(nodist_upstartjob_DATA)
+ $(nodist_upstartjob_DATA) \
+ $(nodist_sysvinitservice_DATA)
EXTRA_DIST += \
%D%/AUTHORS \
@@ -185,7 +196,8 @@ EXTRA_DIST += \
etc/guix-daemon.service.in \
etc/guix-daemon.conf.in \
etc/guix-publish.service.in \
- etc/guix-publish.conf.in
+ etc/guix-publish.conf.in \
+ etc/init.d/guix-daemon.in
if CAN_RUN_TESTS
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [bug#39329] [PATCH v4 2/2] guix-install.sh: Install SysV init script.
2020-01-28 17:38 ` [bug#39329] [PATCH v4 0/2] Start guix-daemon on SysV Danny Milosavljevic
2020-01-28 17:38 ` [bug#39329] [PATCH v4 1/2] Add system start-up files for guix-daemon Danny Milosavljevic
@ 2020-01-28 17:38 ` Danny Milosavljevic
2020-02-14 8:44 ` Ludovic Courtès
2020-03-11 1:49 ` [bug#39329] [PATCH v4 0/2] Start guix-daemon on SysV Danny Milosavljevic
2 siblings, 1 reply; 19+ messages in thread
From: Danny Milosavljevic @ 2020-01-28 17:38 UTC (permalink / raw)
To: 39329; +Cc: Danny Milosavljevic
* etc/guix-install.sh (sys_enable_guix_daemon): Install SysV init script.
---
etc/guix-install.sh | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index bfd3842933..e7f4d2cd59 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -361,6 +361,17 @@ sys_enable_guix_daemon()
systemctl enable guix-daemon; } &&
_msg "${PAS}enabled Guix daemon via systemd"
;;
+ sysv-init)
+ { mkdir -p /etc/init.d;
+ cp "${ROOT_HOME}/.config/guix/current/etc/init.d/guix-daemon" \
+ /etc/init.d/guix-daemon;
+ chmod 775 /etc/init.d/guix-daemon;
+
+ update-rc.d guix-daemon defaults &&
+ update-rc.d guix-daemon enable &&
+ service guix-daemon start; } &&
+ _msg "${PAS}enabled Guix daemon via sysv"
+ ;;
NA|*)
_msg "${ERR}unsupported init system; run the daemon manually:"
echo " ${ROOT_HOME}/.config/guix/current/bin/guix-daemon --build-users-group=guixbuild"
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [bug#39329] [PATCH v4 1/2] Add system start-up files for guix-daemon.
2020-01-28 17:38 ` [bug#39329] [PATCH v4 1/2] Add system start-up files for guix-daemon Danny Milosavljevic
@ 2020-02-14 8:43 ` Ludovic Courtès
0 siblings, 0 replies; 19+ messages in thread
From: Ludovic Courtès @ 2020-02-14 8:43 UTC (permalink / raw)
To: Danny Milosavljevic; +Cc: 39329
Hi Danny,
Danny Milosavljevic <dannym@scratchpost.org> skribis:
> * etc/init.d/guix-daemon.in: New file.
> * nix/local.mk (etc/init.d/guix-daemon): New rule.
> (nodist_sysvinitservice_DATA): Add etc/init.d/guix-daemon.in .
> (CLEANFILES): Add etc/init.d/guix-daemon .
> * .gitignore: Add etc/init.d/guix-daemon .
I haven’t tested the SysV script, but it LGTM!
Could you perhaps mention it in “Binary Install” in the manual, right
after Upstart?
Thanks!
Ludo’.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [bug#39329] [PATCH v4 2/2] guix-install.sh: Install SysV init script.
2020-01-28 17:38 ` [bug#39329] [PATCH v4 2/2] guix-install.sh: Install SysV init script Danny Milosavljevic
@ 2020-02-14 8:44 ` Ludovic Courtès
0 siblings, 0 replies; 19+ messages in thread
From: Ludovic Courtès @ 2020-02-14 8:44 UTC (permalink / raw)
To: Danny Milosavljevic; +Cc: 39329
Danny Milosavljevic <dannym@scratchpost.org> skribis:
> * etc/guix-install.sh (sys_enable_guix_daemon): Install SysV init script.
[...]
> + update-rc.d guix-daemon defaults &&
> + update-rc.d guix-daemon enable &&
> + service guix-daemon start; } &&
> + _msg "${PAS}enabled Guix daemon via sysv"
Maybe s/sysv/SysV/ for clarity.
Otherwise LGTM, thank you!
Ludo’.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [bug#39329] [PATCH v4 0/2] Start guix-daemon on SysV.
2020-01-28 17:38 ` [bug#39329] [PATCH v4 0/2] Start guix-daemon on SysV Danny Milosavljevic
2020-01-28 17:38 ` [bug#39329] [PATCH v4 1/2] Add system start-up files for guix-daemon Danny Milosavljevic
2020-01-28 17:38 ` [bug#39329] [PATCH v4 2/2] guix-install.sh: Install SysV init script Danny Milosavljevic
@ 2020-03-11 1:49 ` Danny Milosavljevic
2 siblings, 0 replies; 19+ messages in thread
From: Danny Milosavljevic @ 2020-03-11 1:49 UTC (permalink / raw)
To: 39329
[-- Attachment #1: Type: text/plain, Size: 329 bytes --]
It might make sense not to use pid files here but to actually test whether the
socket /var/guix/daemon-socket/socket works.
No idea how to do that with just bash. It would be easy in Python.
Committed v4 to guix master as commits 73fbe04107d38f4561636c74d28d7a4935cbb1ef
and fe60ef998f537e0e71bbb3377d5886ad297821d0.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* [bug#39329] [PATCH v4 0/2] Start guix-daemon on SysV.
2020-01-28 15:55 [bug#39329] [PATCH 0/2] Start guix-daemon in SysV Danny Milosavljevic
` (2 preceding siblings ...)
2020-01-28 17:38 ` [bug#39329] [PATCH v4 0/2] Start guix-daemon on SysV Danny Milosavljevic
@ 2020-04-13 17:02 ` Vincent Legoll
2020-04-13 17:46 ` bug#39329: " Leo Famulari
2020-04-13 18:08 ` [bug#39329] " Danny Milosavljevic
3 siblings, 2 replies; 19+ messages in thread
From: Vincent Legoll @ 2020-04-13 17:02 UTC (permalink / raw)
To: 39329; +Cc: Danny Milosavljevic
Hello,
shouldn't this issue be closed ?
--
Vincent Legoll
^ permalink raw reply [flat|nested] 19+ messages in thread
* bug#39329: [PATCH v4 0/2] Start guix-daemon on SysV.
2020-04-13 17:02 ` Vincent Legoll
@ 2020-04-13 17:46 ` Leo Famulari
2020-04-13 18:08 ` [bug#39329] " Danny Milosavljevic
1 sibling, 0 replies; 19+ messages in thread
From: Leo Famulari @ 2020-04-13 17:46 UTC (permalink / raw)
To: Vincent Legoll; +Cc: 39329-done, Danny Milosavljevic
On Mon, Apr 13, 2020 at 07:02:46PM +0200, Vincent Legoll wrote:
> Hello,
>
> shouldn't this issue be closed ?
Yup, done!
Feel free to do this in the future by sending a message to
<NNN-done@debbugs.gnu.org>, where NNN is the bug number.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [bug#39329] [PATCH v4 0/2] Start guix-daemon on SysV.
2020-04-13 17:02 ` Vincent Legoll
2020-04-13 17:46 ` bug#39329: " Leo Famulari
@ 2020-04-13 18:08 ` Danny Milosavljevic
2020-04-13 18:21 ` Leo Famulari
1 sibling, 1 reply; 19+ messages in thread
From: Danny Milosavljevic @ 2020-04-13 18:08 UTC (permalink / raw)
To: Vincent Legoll; +Cc: 39329
[-- Attachment #1: Type: text/plain, Size: 485 bytes --]
Hi Vincent,
I don't know whether it actually works.
I don't feel great just closing this because of that.
I mean SysV is kinda outdated, so I wouldn't even know how to test it myself.
Would Devuan work?
Or Redhat 6/CentOS 6?
Also, it would be a lot better to just check for
/var/guix/daemon-socket/socket availability and usability--but I have no idea
how to use UNIX domain sockets with bash or with tools that would be available
everywhere.
PID files are awful.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* [bug#39329] [PATCH v4 0/2] Start guix-daemon on SysV.
2020-04-13 18:08 ` [bug#39329] " Danny Milosavljevic
@ 2020-04-13 18:21 ` Leo Famulari
2020-04-14 10:40 ` [bug#40601] " Vincent Legoll
0 siblings, 1 reply; 19+ messages in thread
From: Leo Famulari @ 2020-04-13 18:21 UTC (permalink / raw)
To: Danny Milosavljevic; +Cc: Vincent Legoll, 39329
On Mon, Apr 13, 2020 at 08:08:29PM +0200, Danny Milosavljevic wrote:
> I don't know whether it actually works.
>
> I don't feel great just closing this because of that.
Okay, feel free to reopen if you want [0]
> I mean SysV is kinda outdated, so I wouldn't even know how to test it myself.
> Would Devuan work?
> Or Redhat 6/CentOS 6?
I'm sure we will get some bug reports if it doesn't work for them.
> Also, it would be a lot better to just check for
> /var/guix/daemon-socket/socket availability and usability--but I have no idea
> how to use UNIX domain sockets with bash or with tools that would be available
> everywhere.
>
> PID files are awful.
Yeah... there's a reason everyone switched to systemd.
[0]
https://debbugs.gnu.org/server-control.html
^ permalink raw reply [flat|nested] 19+ messages in thread
* [bug#40601] [bug#39329] [PATCH v4 0/2] Start guix-daemon on SysV.
2020-04-13 18:21 ` Leo Famulari
@ 2020-04-14 10:40 ` Vincent Legoll
0 siblings, 0 replies; 19+ messages in thread
From: Vincent Legoll @ 2020-04-14 10:40 UTC (permalink / raw)
To: Leo Famulari, Danny Milosavljevic; +Cc: 40601, 39329
Hello,
I now have tested the patch series in #40601
also on latest devuan-sysvinit x86_64.
On 13/04/2020 20:21, Leo Famulari wrote:
> On Mon, Apr 13, 2020 at 08:08:29PM +0200, Danny Milosavljevic wrote:
>> I don't know whether it actually works.
>>
>> I don't feel great just closing this because of that.
> Okay, feel free to reopen if you want [0]
>
>> I mean SysV is kinda outdated, so I wouldn't even know how to test it myself.
>> Would Devuan work?
>> Or Redhat 6/CentOS 6?
> I'm sure we will get some bug reports if it doesn't work for them.
Here's the first one: ;-)
the sysvinit init.d script relies on "daemonize" which is not
installed by default on devuan.
Would fixing it by checking a second round of REQUIRED_BY_INIT
after checking the init type be the right way ?
Or should I report an issue about that ?
But if daemonize is installed, the sysvinit support works
as expected, and I can run guix commands as for the
other tests I did.
Thanks
--
Vincent Legoll
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2020-04-14 10:41 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-28 15:55 [bug#39329] [PATCH 0/2] Start guix-daemon in SysV Danny Milosavljevic
2020-01-28 15:58 ` [bug#39329] [PATCH 1/2] Add system start-up files for guix-daemon Danny Milosavljevic
2020-01-28 15:59 ` [bug#39329] [PATCH 2/2] guix-install.sh: Install sysv init script Danny Milosavljevic
2020-01-28 16:01 ` Danny Milosavljevic
2020-01-28 16:01 ` [bug#39329] [PATCH 1/2] Add system start-up files for guix-daemon Danny Milosavljevic
2020-01-28 16:29 ` [bug#39329] [PATCH v3 0/2] Start guix-daemon on SysV Danny Milosavljevic
2020-01-28 16:29 ` [bug#39329] [PATCH v3 1/2] Add system start-up files for guix-daemon Danny Milosavljevic
2020-01-28 16:29 ` [bug#39329] [PATCH v3 2/2] guix-install.sh: Install sysv init script Danny Milosavljevic
2020-01-28 17:38 ` [bug#39329] [PATCH v4 0/2] Start guix-daemon on SysV Danny Milosavljevic
2020-01-28 17:38 ` [bug#39329] [PATCH v4 1/2] Add system start-up files for guix-daemon Danny Milosavljevic
2020-02-14 8:43 ` Ludovic Courtès
2020-01-28 17:38 ` [bug#39329] [PATCH v4 2/2] guix-install.sh: Install SysV init script Danny Milosavljevic
2020-02-14 8:44 ` Ludovic Courtès
2020-03-11 1:49 ` [bug#39329] [PATCH v4 0/2] Start guix-daemon on SysV Danny Milosavljevic
2020-04-13 17:02 ` Vincent Legoll
2020-04-13 17:46 ` bug#39329: " Leo Famulari
2020-04-13 18:08 ` [bug#39329] " Danny Milosavljevic
2020-04-13 18:21 ` Leo Famulari
2020-04-14 10:40 ` [bug#40601] " Vincent Legoll
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.