aboutsummaryrefslogtreecommitdiff
path: root/etc/init.d/guix-daemon.in
blob: b7d4bb72bbb748e354bbb2aa7b0417b76cae1f47 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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 --discover=no
  fi
  ;;
stop)
  if [ -f "/var/run/guix-daemon.pid" ]
  then
    pkill -F "/var/run/guix-daemon.pid" guix-daemon || {
      exit 1
    }
    rm -f "/var/run/guix-daemon.pid"
    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
t -rw-r--r--aidc.scm7548logplainabout -rw-r--r--algebra.scm63654logplainabout -rw-r--r--android.scm41109logplainabout -rw-r--r--animation.scm12578logplainabout -rw-r--r--anthy.scm2879logplainabout -rw-r--r--antivirus.scm7329logplainabout -rw-r--r--apl.scm2193logplainabout -rw-r--r--apr.scm4303logplainabout -rw-r--r--arcan.scm11501logplainabout -rw-r--r--aspell.scm17802logplainabout -rw-r--r--assembly.scm14198logplainabout -rw-r--r--astronomy.scm14593logplainabout -rw-r--r--attr.scm2879logplainabout -rw-r--r--audio.scm161914logplainabout -rw-r--r--augeas.scm2648logplainabout -rw-r--r--authentication.scm5568logplainabout -rw-r--r--autogen.scm3063logplainabout -rw-r--r--autotools.scm19575logplainabout d---------aux-files151logplain -rw-r--r--avahi.scm4656logplainabout -rw-r--r--avr.scm7876logplainabout -rw-r--r--axoloti.scm29526logplainabout -rw-r--r--backup.scm45191logplainabout -rw-r--r--base.scm60849logplainabout -rw-r--r--bash.scm15093logplainabout -rw-r--r--batik.scm8852logplainabout -rw-r--r--bdw-gc.scm5933logplainabout -rw-r--r--benchmark.scm11076logplainabout -rw-r--r--bioconductor.scm287993logplainabout -rw-r--r--bioinformatics.scm643768logplainabout -rw-r--r--bison.scm3053logplainabout -rw-r--r--bittorrent.scm20415logplainabout -rw-r--r--boost.scm14626logplainabout -rw-r--r--bootloaders.scm45848logplainabout -rw-r--r--bootstrap.scm34139logplainabout -rw-r--r--build-tools.scm13271logplainabout -rw-r--r--busybox.scm6344logplainabout -rw-r--r--c.scm10507logplainabout -rw-r--r--calcurse.scm3490logplainabout -rw-r--r--calendar.scm12411logplainabout -rw-r--r--ccache.scm2469logplainabout -rw-r--r--cdrom.scm40773logplainabout -rw-r--r--cedille.scm5517logplainabout -rw-r--r--certs.scm8919logplainabout -rw-r--r--check.scm96849logplainabout -rw-r--r--chemistry.scm14364logplainabout -rw-r--r--chez.scm27260logplainabout -rw-r--r--chicken.scm2767logplainabout -rw-r--r--chromium.scm40833logplainabout -rw-r--r--ci.scm7086logplainabout -rw-r--r--cinnamon.scm3320logplainabout -rw-r--r--clojure.scm13328logplainabout -rw-r--r--cluster.scm5230logplainabout -rw-r--r--cmake.scm11673logplainabout -rw-r--r--cobol.scm2997logplainabout -rw-r--r--code.scm29716logplainabout -rw-r--r--commencement.scm111572logplainabout -rw-r--r--compression.scm93314logplainabout -rw-r--r--compton.scm5990logplainabout -rw-r--r--conky.scm3495logplainabout -rw-r--r--connman.scm7259logplainabout -rw-r--r--cook.scm4102logplainabout -rw-r--r--coq.scm25571logplainabout -rw-r--r--cpio.scm1971logplainabout -rw-r--r--cpp.scm19276logplainabout -rw-r--r--cppi.scm1775logplainabout -rw-r--r--cran.scm776313logplainabout -rw-r--r--crates-io.scm853065logplainabout -rw-r--r--cross-base.scm24204logplainabout -rw-r--r--crypto.scm47041logplainabout -rw-r--r--cryptsetup.scm6211logplainabout -rw-r--r--cups.scm38506logplainabout -rw-r--r--curl.scm11056logplainabout -rw-r--r--cvassistant.scm3640logplainabout -rw-r--r--cybersecurity.scm1800logplainabout -rw-r--r--cyrus-sasl.scm3020logplainabout -rw-r--r--databases.scm137884logplainabout -rw-r--r--datamash.scm1969logplainabout -rw-r--r--datastructures.scm12381logplainabout -rw-r--r--dav.scm4789logplainabout -rw-r--r--dbm.scm6103logplainabout