「Systemd」:修訂間差異

出自Gea-Suan Lin's Wiki
跳至導覽 跳至搜尋
本頁面具有訪問限制。如果您看見此訊息,這代表您沒有訪問本頁面的權限。
行 4: 行 4:
== 範例 ==
== 範例 ==


 這是一個很簡單的範例:
 這是一個很簡單的範例 ,放在<code>/etc/systemd/system/</code>下


<syntaxhighlight lang="ini">
<syntaxhighlight lang="ini">
行 22: 行 22:
</syntaxhighlight>
</syntaxhighlight>


 這是user模式下的(因為user模式下沒有<code>multi-user.target</code>,也不需要<code>remote-fs.target</code>):
 這是user模式下的(因為user模式下沒有<code>multi-user.target</code>,也不需要<code>remote-fs.target</code>) ,放在<code>~/.config/systemd/user/</code>下


<syntaxhighlight lang="ini">
<syntaxhighlight lang="ini">

於 2023年10月7日 (六) 05:05 的修訂

systemd是一個系統套件。

範例

這是一個很簡單的範例,放在/etc/systemd/system/下:

#
[Unit]
Description=Description
After=remote-fs.target

[Service]
ExecStart=/usr/bin/spawn-fcgi
Restart=on-failure
RestartSec=60
Type=simple

[Install]
WantedBy=multi-user.target

這是user模式下的(因為user模式下沒有multi-user.target,也不需要remote-fs.target),放在~/.config/systemd/user/下:

#
[Unit]
Description=Description

[Service]
ExecStart=/usr/bin/spawn-fcgi
Restart=on-failure
RestartSec=60
Type=simple

[Install]
WantedBy=default.target

外部連結