3

So I'm currently merging an XMPP server with a Signal gateway for efficiency (running each service in a separate VM eats resources like nobody's business) and I need to convert the service script for the gateway to work on the XMPP's Alpine (short of switching it all to Arch) so I can start and stop with regular commands and start the service at boot. Unfortunately there isn't much complete documentation on Alpine. Here's what I have on the current Debian server:

[Unit]
Description=signal-web-gateway daemon
After=network.target

[Service]
PIDFile=/run/signal-web-gateway/pid
User=signal
Group=signal
RuntimeDirectory=signal-web-gateway
WorkingDirectory=/home/signal/
ExecStart=/home/signal/signal -gateway -bind 127.0.0.1:5010
PrivateTmp=true

[Install]
WantedBy=multi-user.target

And basically I want to know how to translate that to OpenRC (Alpine) and where to put it.

Using this: https://gitlab.com/morph027/signal-web-gateway

Darkness
  • 53
  • 1
  • 8

1 Answers1

4

Here is a simple init script for your service.

#!/sbin/openrc-run

depend() {
    need net
}

command="/home/signal/signal"
command_args="-gateway -bind 127.0.0.1:5010"
command_user="signal:signal"
pidfile="/run/${RC_SVCNAME}/pid"

I've also created an issue for the project here, https://gitlab.com/morph027/signal-web-gateway/issues/11

Note: The Alpine Wiki page on writing initscripts recommends the resources below for configuring services.

Resources

oxr463
  • 352
  • 1
  • 2
  • 14