Manipulating operating system services
To be able to start, stop and restart the operating system services, you must use the command orbit service
.
mt4adm@vmdf-giskard:~$ sudo orbit service --help
Usage: orbit service <service> <command>
Send commands to the systemd manager
Arguments:
<service> The service name
<command> Systemd command: [start|stop|restart|status]
Flags:
--help Show context-sensitive help.
--force Force the command execution, never prompt
--show
As an example, let's see the status of the SNMP service.
mt4adm@vmdf-giskard:~$ sudo orbit service snmpd status
● snmpd.service - Simple Network Management Protocol (SNMP) Daemon.
Loaded: loaded (/lib/systemd/system/snmpd.service; enabled; vendor
preset: enabled)
Active: active (running) since Fri 2020-06-12 21:18:21 CEST; 41min ago
Process: 11119 ExecStartPre=/bin/mkdir -p /var/run/agentx (code=exited,
status=0/SUCCESS)
Main PID: 11120 (snmpd)
Tasks: 1 (limit: 3489)
Memory: 7.7M
CGroup: /system.slice/snmpd.service
└─11120 /usr/sbin/snmpd -Lsd -Lf /dev/null -u Debian-snmp -g
Debian-snmp -I -smux mteTrigger mteTriggerConf -f -p /run/snmpd.pid
To restart a service just use the command restart
. The same syntax as in the example can be used for the commands start
and stop
, which will start and stop services respectively.
mt4adm@vmdf-giskard:~$ sudo orbit service snmpd restart
Are you sure you want to proceed: y