Services¶
Systemd (systemctrl)¶
How To Use Systemctl to Manage Systemd Services and Units
systemctl enable differs from systemctl start, how?
Services can also be stated as "application.service".
Test if a service is running:
systemctrl is-active mysqld
Test if a service is set to run at startup:
systemctl is-enabled mysqld
Test if a service has failed:
systemctl is-failed mysqld
Start a service:
systemctrl start mysqld
Stop a service:
systemctrl stop mysqld
Restart service:
Restart or start:
systemctrl restart mysqld
Restart only if running:
systemctl condrestart foobar.service
Reload configuration:
systemctrl reload mysqld
systemctl reload-or-restart mysqld
Start service at boot:
systemctl enable mysqld
To enable and start:
systemctl enable --now mysqld
Disable boot startup:
systemctl disable mysqld
Check status and basic info:
systemctl status mysqld
This will provide you with the service state, the cgroup hierarchy, and the first few log lines.
Names of various services¶
Mariadb = mysqld Samba = smb and nmb
Sys V¶
Stop a service:
service NetworkManager stop
Disable a service from starting at boot:
chkconfig NetworkManager off
Scheduling¶
Systemd¶
Chron¶
Desktop notifications¶
notify-send¶
A program to send desktop notifications, inform the user about an event or display some form of information without getting in the user’s way.
Syntax¶
notify-send [OPTIONS] [body]
Key¶
-u, --urgency=LEVEL
The urgency level (low, normal, critical).
-t, --expire-time=TIME
The timeout in milliseconds at which to expire the
notification.
-i, --icon=ICON[,ICON...]
An icon filename or stock icon to display.
-c, --category=TYPE[,TYPE...]
Specifies the notification category.
-?, --help
Show a help message
-h, --hint=TYPE:NAME:VALUE
Pass extra data. Valid TYPEs are int, double, string and byte.
To use notify-send, you might need to install the following package: $ sudo apt-get install libnotify-bin
Examples¶
$ notify-send "Hello World"
$ notify-send -t 5000 -u low "Hello World"
The return status is zero if all information was written successfully.