lk/distros/void/sv.md

54 lines
1.1 KiB
Markdown
Raw Normal View History

2022-01-16 18:20:39 +00:00
---
title: "sv"
2023-01-06 20:13:45 +00:00
tags: [ "Documentation", "Void" ]
2022-01-16 18:20:39 +00:00
---
2020-01-09 13:15:55 +00:00
# List Services
2020-01-02 00:04:35 +00:00
2020-01-09 13:15:55 +00:00
All possible services are in:
> ls /etc/sv
The computer only uses those in /var/service, so symbolic links are made to start and stop services.
> ls /var/service
# Start Services
Enable the sshd service, so that ssh will work every time you boot up:
> sudo ln -s /etc/sv/sshd /var/service
Then start the service:
> sudo sv start sshd
# Stop Services
Stop `mpd` with:
> sudo sv stop mpd
2022-05-20 17:04:51 +00:00
And stop it automatically loading at startup with:
2020-01-09 13:15:55 +00:00
> sudo rm /var/service/mpd
You can also just make a file called 'down':
> sudo touch /var/service/mpd/down
This means you can start and stop the service without making symbolic links, but mpd will be 'down' when the computer starts.
2020-01-02 00:04:35 +00:00
# Making a Service
2020-01-09 13:15:55 +00:00
Look in the `/etc/sv` directory, then in the existing services' 'run' files.
2020-01-02 00:04:35 +00:00
You'll find a simple dash script (therefore Posix compliant).
2020-01-09 13:15:55 +00:00
You can write your own, just stick in the shebang `#!/bin/sh`.
If unsure, use `#!/bin/bash` as the first line. When Void Linux says `sh`, it means `dash` shell, not `bash`.
Confirm the shell you'll use:
> ls -l $(which sh)