mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-10-27 06:21:36 +01:00
runit runs ok without a symlink to /etc/service in /run but without it sv commands do not work properly.
40 lines
1.1 KiB
Plaintext
40 lines
1.1 KiB
Plaintext
For service supervision with runit:
|
|
|
|
(1) add scripts into /etc/sv/<service>/run
|
|
|
|
------------------------------
|
|
Example: /etc/sv/nginx/run |
|
|
------------------------------
|
|
#!/bin/sh
|
|
mkdir -p /tmp/nginx
|
|
exec /usr/sbin/nginx
|
|
------------------------------
|
|
Example: /etc/sv/ssh/run |
|
|
------------------------------
|
|
#!/bin/sh
|
|
set -e
|
|
ssh-keygen -A
|
|
exec /usr/sbin/sshd -D
|
|
------------------------------
|
|
Example: /etc/sv/tinyssh/run |
|
|
---------------------------------------------------------------------------------
|
|
#!/bin/sh
|
|
PORT=22
|
|
mkdir -p /etc/tinyssh
|
|
/usr/sbin/tinysshd-makekey /etc/tinyssh/sshkeys 2>/dev/null
|
|
exec tcpserver -HRDl0 0.0.0.0 $PORT /usr/sbin/tinysshd -v -l /etc/tinyssh/sshkeys
|
|
---------------------------------------------------------------------------------
|
|
|
|
(2) set permissions:
|
|
|
|
chmod 700 /etc/sv/<service>/run
|
|
|
|
(3) symlink the script directory to the service directory:
|
|
|
|
ln -s /etc/sv/nginx /etc/service/nginx
|
|
|
|
==========================================================
|
|
|
|
The socklog package by the same author can provide logging
|
|
with built in log rotation & also be managed by runit.
|