-
Notifications
You must be signed in to change notification settings - Fork 3
Services
belese edited this page Jan 24, 2013
·
6 revisions
All commands in the service module gives a return code of either 0 or 1, where 0 is failure and 1 is success. Other codes that can be expected are:
- 5: Running and autostart enabled
- 4: Running but autostart disabled
- 3: Not running but autostart enabled
- 2: Not running and autostart disabled
- 1: Success
- 0: Failed
- -1: Invalid number of arguments
- -2: Service not available
- -3: Service already running
- -4: Service already stopped
- -5: Autostart already enabled
- -6: Autostart already disabled
- -7: Services config file does not exists
root@xbian:~# xbian-config services
Available arguments for module 'services' are:
list select status start restart stop autostart insert update delete
root@xbian:~# xbian-config services list
apache2
couchpotato
headphones
lirc
nzbgetd
sabnzbdplus
samba
sickbeard
ssh
transmission
xbmc
root@xbian:~# xbian-config services select samba
smbd nmbd
root@xbian:~# xbian-config services status
apache2 5
couchpotato 2
headphones 2
lirc 5
nzbgetd 2
sabnzbdplus 2
samba 5
sickbeard 2
ssh 5
transmission 2
xbmc 5
root@xbian:~# xbian-config services start xbmc
1
root@xbian:~# xbian-config services stop xbmc
1
root@xbian:~# xbian-config services restart xbmc
1
root@xbian:~# xbian-config services autostart xbmc enable
1
root@xbian:~# xbian-config services autostart xbmc disable
1
The first argument of insert is always the name of the service. The subsequent number of arguments are the daemon that the service consists of. Samba consists of the nmbd and smbd daemon. So they both need to run to succesfully run the samba service. Just like xbmc consists of xbmc.bin as its daemon.
root@xbian:~# xbian-config services insert samba nmbd smbd
1
The apache2 service is just called apache2 so no additional arguments are needed.
root@xbian:~# xbian-config services insert apache2
1
root@xbian:~# xbian-config services delete apache2
1