认识
systemctl – Control the systemd system and service manager
systemctl may be used to introspect and control the state of the “systemd” system and service manager. Please refer to systemd(1) for an introduction into the basic concepts and functionality this tool manages.
常用命令
开机启动不在默认目录中的单元文件:
systemctl enable /path/to/my-service-file.serivce
语法格式
systemctl [OPTIONS...] COMMAND [NAME...]
命令描述
命令行参数:COMMAND
The following commands are understood:
Manager Lifecycle Commands
daemon-reload
重新加载 systemd 管理器配置。这将:重新运行所有「生成器」(参阅systemd.generator(7)手册),重新加载所有单元文件,然后重新创建整个依赖关系树。
在重新加载守护程序时,“由 systemd 监听”、“代表用户配置”的所有套接字将保持可访问状态。
不应将此命令与reload命令混淆。
daemon-reexec
Reexecute the systemd manager. This will serialize the manager state, reexecute the process and deserialize the state again. This command is of little use except for debugging and package upgrades. Sometimes, it might be helpful as a heavy-weight daemon-reload. While the daemon is being reexecuted, all sockets systemd listening on behalf of user configuration will stay accessible.
附加说明
注意事项
参考
man 1 systemctl, Version systemd 232
configuration – Systemd service files in non-default directory – Ask Ubuntu