Begin adding systemd compatibility.
The Makefile can be used to build and install rlgwebd. On systems with systemd, the unit file controls starting and stopping the service, and the shell script is not needed. The unit file uses KillMode=none because socat does not actually stop rlgwebd, it only asks it to stop and exits without waiting for a response. Until a better stopping method is introduced, this setting prevents systemd from killing all the rlgwebd processes as soon as socat exits.
This commit is contained in:
parent
bf9661169d
commit
ec5c79d46e
2 changed files with 37 additions and 0 deletions
24
Makefile
Normal file
24
Makefile
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
CHROOT=/var/dgl
|
||||||
|
|
||||||
|
WEBASSETS = about.html bell.svg index.html options.html options.js rlgterm.js \
|
||||||
|
style-rlg.css termemu.js termemu-keys.js tty.css
|
||||||
|
|
||||||
|
all: sqlickrypt dglwatcher
|
||||||
|
|
||||||
|
sqlickrypt: sqlickrypt.c
|
||||||
|
cc -o sqlickrypt sqlickrypt.c -lcrypt -lsqlite3
|
||||||
|
|
||||||
|
dglwatcher: dglwatcher.c
|
||||||
|
cc -o dglwatcher dglwatcher.c
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f sqlickrypt dglwatcher
|
||||||
|
|
||||||
|
install: all
|
||||||
|
mkdir -p ${CHROOT}/bin
|
||||||
|
cp sqlickrypt dglwatcher ${CHROOT}/bin
|
||||||
|
for LIB in `ldd ./sqlickrypt | awk '$$1 ~ "^/" {print $$1}; $$3 ~ "^/" {print $$3}'`; do mkdir -p ${CHROOT}`dirname $$LIB`; cp $$LIB ${CHROOT}$$LIB; done
|
||||||
|
cp rlgwebd.js /usr/local/bin/rlgwebd.js
|
||||||
|
mkdir -p /var/local/rlgwebd
|
||||||
|
cp ${WEBASSETS} ${CHROOT}/var/www
|
||||||
|
cp rlgwebd.service /usr/lib/systemd/system
|
||||||
13
rlgwebd.service
Normal file
13
rlgwebd.service
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
[Unit]
|
||||||
|
Description=RLGWebD app daemon
|
||||||
|
After=network.target syslog.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
Environment=NODE_PATH=/usr/lib/node_modules
|
||||||
|
ExecStart=/usr/bin/node /usr/local/bin/rlgwebd.js
|
||||||
|
ExecStop=/usr/bin/socat "EXEC:echo quit" /var/local/rlgwebd/ctl
|
||||||
|
KillMode=none
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
Loading…
Add table
Add a link
Reference in a new issue