5

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

1 Answer 1

5

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

2
  • 1
    Thanks a lot! I'm guessing service name will be the file name, right?
    – Darkness
    Commented Jul 10, 2019 at 13:24
  • Yes, that should be right.
    – oxr463
    Commented Jul 10, 2019 at 15:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .