Reviewed-on: #21
rclone OpenRC Alpine Package
Provides a generic, instance-capable OpenRC service for Alpine's rclone
package. It does not repackage the rclone binary.
Install
apk add rclone-openrc
The package creates the unprivileged rclone account, /etc/rclone for
configuration and credentials, and /var/lib/rclone/cache for rclone state.
It deliberately does not create remotes, credentials, authorized-key files, or
SSH host keys; provision those as machine-specific secrets.
Create an Instance
Copy the template and symlink the generic service under an instance name:
cp /etc/conf.d/rclone /etc/conf.d/rclone.sftp
ln -s rclone /etc/init.d/rclone.sftp
For an SFTP server, configure /etc/conf.d/rclone.sftp:
RCLONE_COMMAND="serve sftp"
RCLONE_REMOTE="/srv/storage"
RCLONE_ARGS="
--addr :2022
--authorized-keys /etc/rclone/authorized_keys
--key /etc/rclone/ssh_host_ed25519_key
--log-level INFO
"
Then enable and start it:
rc-update add rclone.sftp default
rc-service rclone.sftp start
Other instances, such as rclone.webdav or rclone.rcd, use their own
/etc/conf.d/rclone.<name> file with the same generic init script. The service
runs rclone in the foreground under supervise-daemon, which restarts it after
an unexpected exit. Set RCLONE_RESPAWN_MAX to a positive value to limit
restart attempts.
Package Commands
ALPINE_PACKAGE=rclone-openrc mise run apk:checksum
ALPINE_PACKAGE=rclone-openrc mise run apk:build
ALPINE_PACKAGE=rclone-openrc SKIP_BUILD=1 mise run apk:test-install
ALPINE_PACKAGE=rclone-openrc mise run apk:runtime-test