Zero Downtime Linux and Systemd Scripting
1. Custom Systemd Startup Scripts
Custom init scripts are often necessary as not all applications come with their own. Here are some examples of writing custom systemd startup scripts:
1.1 Simple Cleanup Script
The following is a simple systemd startup script named chrisbinnie - cleanup :
[Unit]
Description=Clear out an old disk cache somewhere
[Service]
Type=oneshot
ExecStart=/usr/sbin/chrisbinnie-cleanup
[Install]
WantedBy=multi-user.target
In this example, the Type=oneshot indicates that the unit executes an action and then stops. To enable it to start at boot time, run the command:
超级会员免费看
订阅专栏 解锁全文
8177

被折叠的 条评论
为什么被折叠?



