Linux command
systemd-notify 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Notify
systemd-notify --booted
Signal
systemd-notify --ready
Provide
systemd-notify --status "[Add custom status message here...]"
说明
systemd-notify notifies the service manager about start-up completion and other daemon status changes. It is primarily used within systemd service scripts for services with Type=notify. The status text provided with --status is displayed by systemctl status. This allows services to communicate their current state and progress to administrators.
参数
- --ready
- Signal service readiness to systemd
- --booted
- Check if system was booted with systemd
- --status _text_
- Send status text to service manager
- --pid _pid_
- Inform about main PID of daemon
- --uid _user_
- Specify the user to notify as
- --reloading
- Signal that service is reloading configuration
- --stopping
- Signal that service is stopping
FAQ
What is the systemd-notify command used for?
systemd-notify notifies the service manager about start-up completion and other daemon status changes. It is primarily used within systemd service scripts for services with Type=notify. The status text provided with --status is displayed by systemctl status. This allows services to communicate their current state and progress to administrators.
How do I run a basic systemd-notify example?
Run `systemd-notify --booted` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --ready do in systemd-notify?
Signal service readiness to systemd