blob: da639fb64cbe30495d2651ab06a0fa564a0a095b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
<!DOCTYPE HTML>
<html lan="en">
<head>
<title>Service Management | Carbs Linux</title>
<link rel="stylesheet" href="/assets/style.css">
<meta charset="utf-8">
<meta name="Description" content="Carbs Linux - a simple busybox linux distribution">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
</head>
<p class=header><strong>Carbs Linux - a simple busybox linux distribution</strong></p>
<div class="header"><nav>
<a href='/'>index</a>
<a href='https://github.com/CarbsLinux'>github</a>
<a href='//dl.carbslinux.org'>downloads</a>
<a href='/blog'>blog</a>
<a href='/wiki'>wiki</a>
<a href='/wiki/install.html'>installation</a>
</nav></div><div class="border"></div>
<p>Carbs Linux uses <code>busybox-runit</code> by default, but the repository additionally has the
original <code>runit</code> and <code>sysmgr</code>. You can install either with <code>kiss b runit; kiss i runit</code>
or <code>kiss b sysmgr; kiss i sysmgr</code>.</p>
<h1>runit</h1>
<p><strong>Enabling a Service</strong></p>
<pre><code>ln -sf /etc/sv/acpid /var/service
</code></pre>
<p><strong>Disabling a Service</strong></p>
<pre><code>unlink /var/service/acpid
</code></pre>
<p><strong>Starting a Service</strong></p>
<pre><code>sv start acpid
</code></pre>
<p><strong>Stopping a Service</strong></p>
<pre><code>sv stop acpid
</code></pre>
<p>For more information refer to the <code>sv --help</code> output. Also check out the <code>sv(8)</code>
manual page if you have installed the <code>runit</code> package.</p>
<h1>sysmgr</h1>
<p><a href="https://github.com/cemkeylan/sysmgr">sysmgr</a> is POSIX-sh service supervisor written by me. Its usage resembles
<code>runit</code>. The biggest difference is that <code>sysmgr</code> uses service files instead
of directories with run scripts inside.</p>
<h2>svctl</h2>
<p><code>svctl</code> is the equivalant of <code>sv</code> for sysmgr. You can run the above commands for
<code>runit</code> and use <code>svctl</code> instead of <code>sv</code>. Those would be as follows.</p>
<p><strong>Enabling a Service</strong></p>
<pre><code>ln -sf /etc/sysmgr/acpid /var/sysmgr
</code></pre>
<p><strong>Disabling a Service</strong></p>
<pre><code>unlink /var/sysmgr/acpid
</code></pre>
<p><strong>Starting a Service</strong></p>
<pre><code>svctl start acpid
</code></pre>
<p><strong>Stopping a Service</strong></p>
<pre><code>svctl stop acpid
</code></pre>
<h2>Switching from runit</h2>
<p>Switching from <code>runit</code> is fairly easy. You can run the following commands to get
started with <code>sysmgr</code>.</p>
<pre><code># Create the directories if you haven't yet
mkdir -p /var/sysmgr /etc/sysmgr
# Copy all of the run scripts to /etc/sysmgr
set -- /etc/sv/*
for service; do cp "$service/run" "/etc/sysmgr/${service##*/}" ; done
# Link all enabled services
set -- /var/service/*
for service; do ln -sf /etc/sysmgr/${service##*/} /var/sysmgr ; done
</code></pre>
<a href="/wiki/system/service-management.txt">View Page Source</a><div class=border></div>
<p class=footer>Linux® is a registered trademark of Linus Torvalds</p>
<p class=footer>Copyright © 2019-2020 Cem Keylan</p>
</body>
</html>
|