Can rqlite run as a Linux service? so it can be start/stop/restart with systemctl command. Any example of the service file would be appreciated.
Can rqlite run as a Linux service? so it can be start/stop/restart with systemctl command. Any example of the service file would be appreciated.
A basic systemd service file with ExecStart set to your rqlited command should suffice. See example below.
A more thorough service file can be found in the very good Arch User Repo package of rqlite. It also includes creation of rqlite system user and directory and more security considerations.
Information on how to form a cluster with rqlite started as a service can be found on XenGi, the packager's page. It makes use of an environment file that sets the arguments of rqlite nodes.
[Unit]
Description=
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/rqlited -http-addr 0.0.0.0:4001 -raft-addr 0.0.0.0:4002 /path/to/datadir
User=youruser
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGTERM
Restart=always
[Install]
WantedBy=multi-user.target