[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
howtos:slackware_admin:runit [2019/01/31 11:57 (UTC)] – Introduced a solution for DE and the finish script chrisabela | howtos:slackware_admin:runit [2019/05/30 12:34 (UTC)] – chrisabela | ||
---|---|---|---|
Line 10: | Line 10: | ||
To read on the benefits of runit, see here: http:// | To read on the benefits of runit, see here: http:// | ||
+ | |||
+ | Unless otherwise stated, all commands in this article are to be run by root. | ||
===== 2. Use runit with traditional init ===== | ===== 2. Use runit with traditional init ===== | ||
Line 81: | Line 83: | ||
If you followed the previous chapter, then stop runsvdir and reverse all the changes that you made on your system. | If you followed the previous chapter, then stop runsvdir and reverse all the changes that you made on your system. | ||
- | Remove | + | So, remove |
< | < | ||
Line 87: | Line 89: | ||
</ | </ | ||
- | Reboot: | + | And reboot: |
< | < | ||
Line 188: | Line 190: | ||
The traditional init reads ''/ | The traditional init reads ''/ | ||
- | The script ''/ | + | The script ''/ |
Note that the shutdown command provided by sysvinit package will not work in runit. To reboot you enter | Note that the shutdown command provided by sysvinit package will not work in runit. To reboot you enter | ||
Line 225: | Line 227: | ||
</ | </ | ||
- | In order to let the non-privileged | + | As a non-priviliged |
< | < | ||
- | chmod -R chris.users | + | mkdir -p /home/bob/runit/logs |
</ | </ | ||
- | As a non-priviliged user, create some directories | + | Then edit a '' |
- | + | ||
- | < | + | |
- | mkdir -p /home/chris/runit/logs | + | |
- | </ | + | |
- | + | ||
- | Then edit a script that simulates a (finicky) service in a convenient directory; say | + | |
< | < | ||
Line 254: | Line 250: | ||
< | < | ||
- | chmod +x /home/chris/ | + | chmod +x /home/bob/ |
</ | </ | ||
Line 260: | Line 256: | ||
< | < | ||
- | /home/chris/ | + | /home/bob/ |
</ | </ | ||
- | Edit a file called ''/ | + | Log in back as root and edit a file called ''/ |
< | < | ||
#!/bin/sh -e | #!/bin/sh -e | ||
exec 2>&1 | exec 2>&1 | ||
- | exec chpst -u chris /home/chris/ | + | exec chpst -u bob /home/bob/ |
</ | </ | ||
Line 285: | Line 281: | ||
</ | </ | ||
- | and edit another file under it also called ''/ | + | and edit another file under it, also called ''/ |
< | < | ||
#!/bin/sh | #!/bin/sh | ||
- | exec chpst -u chris svlogd -tt /home/chris/runit/logs | + | exec chpst -u bob svlogd -tt /home/bob/runit/logs |
</ | </ | ||
Line 298: | Line 294: | ||
</ | </ | ||
- | Run the sv service to ensure that it works: | + | Run the service to ensure that it works: |
< | < | ||
Line 311: | Line 307: | ||
Watch how your " | Watch how your " | ||
+ | |||
+ | As your non-privilged user: | ||
< | < | ||
- | tail -f /home/chris/ | + | tail -f /home/bob/runit/ |
</ | </ | ||
+ | |||
+ | Hit CTRL+C to exit. | ||
+ | |||
+ | Finally, login back as root and let bob take the ownership of the whole ''/ | ||
+ | |||
+ | < | ||
+ | chown -R bob.users / | ||
+ | </ | ||
+ | |||
+ | Now bob can manage this service with the '' | ||
===== 7. Managing Services with sv ===== | ===== 7. Managing Services with sv ===== | ||
Line 357: | Line 365: | ||
Each of these is a shortcut, for ' | Each of these is a shortcut, for ' | ||
- | More verbose forms of the above | + | |
+ | More verbose forms of the above: | ||
< | < | ||
- | sv start sshd | + | sv start example |
- | sv stop sshd | + | sv stop example |
- | sv restart | + | sv restart |
</ | </ | ||
Line 528: | Line 537: | ||
<!-- Please do not modify anything below, except adding new tags.--> | <!-- Please do not modify anything below, except adding new tags.--> | ||
{{tag> | {{tag> | ||
- | |||
- |