Skip to content
Snippets Groups Projects
Commit a8b1ff2f authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

provide status doc

parent 4f1b7a3c
No related branches found
No related tags found
No related merge requests found
title: The 66 Suite: 66-inservice
author: Eric Vidal <eric@obarun.org>
[66](index.html)
[Software](https://web.obarun.org/software)
[obarun.org](https://web.obarun.org)
# 66-inservice
This command displays information about services.
## Interface
```
66-inservice [ -h ] [ -z ] [ -v verbosity ] [ -n ] [ -o name,intree,status,... ] [ -g ] [ -d depth ] [ -r ] [ -t tree ] [ -p nline ] service
```
## Exit codes
- *0* success
- *100* wrong usage
- *111* system call failed
## Options
- **-h** : prints this help.
- **-z** : use color.
- **-v** *verbosity* : increases/decreases the verbosity of the command.
* *1* : only print error messages. This is the default.
* *2* : also print warning messages.
* *3* : also print tracing messages.
* *4* : also print debugging messages.
- **-n** : do not display the field name(s) specified.
- **-o** : comma separated list of fields to display. If this option is not passed, *66-inservice* will display all fields.
- **-g** : shows the dependency list of the *service* as a hierarchical graph instead of a list.
- **-d** *depth* : limits the depth of the dependency list visualisation; default is 1. This implies **-g** option.
- **-r** : shows the dependency list of *services* in reverse mode.
- **-t** *tree* : only searches the *service* at the specified *tree*, when the same service may be enabled in more trees.
- **-p** *nline* : prints the *nline* last lines from the log file of the *service*. Default is 20.
## Valid fields for -o options
- *name* : displays the name of the *service*.
- *intree* : displays the *service*'s tree name.
- *status* : displays the status.
- *type* : displays the *service* type.
- *description* : displays the description.
- *source* : displays the source of the *service*'s [frontend](frontend.html) file.
- *live* : displays the *service*'s live directory.
- *depends* : displays the *service*'s dependencies.
- *extdepends* : displays the *service*'s external dependencies.
- *optsdepends* : displays the *service*'s optional dependencies.
- *start* : displays the *service*'s start script.
- *stop* : displays the *service*'s stop script.
- *envat* : displays the source of the environment file.
- *envfile* : displays the contents of the environment file.
- *logname* : displays the logger's name.
- *logdst* : displays the logger's destination.
- *logfile* : displays the contents of the log file.
## Command and output examples
The command `66-inservice 00` run as root user on [Obarun](https://web.obarun.org)'s default system, displays the following, where *00* is a service contained in the tree boot:
```
Name : 00
In tree : boot
Status : enabled, nothing to display
Type : bundle
Description : Set the hostname and mount filesystem
Source : %%service_system%%/boot/mount/00
Live : %%livedir%%/tree/0/boot/servicedirs/00
Dependencies : system-hostname mount-run populate-run mount-tmp populate-tmp mount-proc mount-sys
populate-sys mount-dev mount-pts mount-shm populate-dev mount-cgroups
External dependencies : None
Optional dependencies : None
Start script : None
Stop script : None
Environment source : None
Environment file : None
Log name : None
Log destination : None
Log file : None
```
***Note***: the *Optional dependencies* and *External dependencies* also displays the name of the tree where the service is currently enabled after the `colon(:)` mark if any:
```
External dependencies : dbus-session@obarun:base gvfsd:desktop
Optional dependencies : picom@obarun:desktop
```
By default the dependency graph is rendered in the order of execution. In this example the `oneshot` system-hostname is the first executed service and `oneshot` *mount-cgroups* is the last one when it finishes. You can reverse the rendered order with the **-r** option.
You can display the *status* and *depends on* field and only these fields of a *service* using the command `66-inservice -o status,depends -g <service>` connmand where the dependency list is diplayed as a graph:
```
Status : enabled, up (pid 938) 34652 seconds
Dependencies : /
├─(933,Enabled,longrun) dbus
└─(929,Enabled,longrun) connmand-log
```
You can display the status,log file and log destination and only these fields of a service using the command `66-inservice -o status,logdst,logfile -g dbus`:
```
Status : enabled, up (pid 933) 34852 seconds, ready 34852 seconds
Log destination : %%system_log%%/dbus
Log file :
2019-10-03 16:16:05.246991500 dbus-daemon[933]: [system] Rejected send message, 4 matched rules; type="method_call", sender=":1.3" (uid=1000 pid=1226 comm="connman-gtk --tray ") interface="net.connman.Technology" member="Scan" error name="(unset)" requested_reply="0" destination=":1.0" (uid=0 pid=938 comm="connmand -n --nobacktrace --nodnsproxy ")
2019-10-03 16:16:35.256146500 dbus-daemon[933]: [system] Rejected send message, 4 matched rules; type="method_call", sender=":1.3" (uid=1000 pid=1226 comm="connman-gtk --tray ") interface="net.connman.Technology" member="Scan" error name="(unset)" requested_reply="0" destination=":1.0" (uid=0 pid=938 comm="connmand -n --nobacktrace --nodnsproxy ")
```
title: The 66 Suite: 66-intree
author: Eric Vidal <eric@obarun.org>
[66](index.html)
[Software](https://web.obarun.org/software)
[obarun.org](https://web.obarun.org)
# 66-intree
This command displays information about trees.
## Interface
```
66-intree [ -h ] [ -z ] [ -v verbosity ] [ -l live ] [ -n ] [ -o name,init,enabled,... ] [ -g ] [ -d depth ] [ -r ] tree
```
## Exit codes
- *0* success
- *100* wrong usage
- *111* system call failed
## Options
- **-h** : prints this help.
- **-z** : use color.
- **-v** *verbosity* : increases/decreases the verbosity of the command.
* *1* : only print error messages. This is the default.
* *2* : also print warning messages.
* *3* : also print tracing messages.
* *4* : also print debugging messages.
- **-l** *live* : changes the supervision directory of *service* to *live*. By default this will be `%%livedir%%`. The default can also be changed at compile time by passing the `--livedir=live` option to `./configure`. An existing absolute path is expected and should be within a writable and executable filesystem - likely a RAM filesystem—see [66-scandir](66-scandir.html).
- **-n** : do not display the field name(s) specified.
- **-o** : comma separated list of fields to display. If this option is not passed, *66-intree* will display all fields.
- **-g** : shows the dependency list of the *service* as a hierarchical graph instead of a list.
- **-d** *depth* : limits the depth of the dependency list visualisation; default is 1. This implies **-g** option.
- **-r** : shows the dependency list of *tree* in reverse mode.
***(!)*** If tree is not specified *66-intree* will display information about all available trees for the current owner of the process. In this case, It displays first the trees which is not marked enabled in alphabetical order then the trees marked enabled in start order.
## Valid fields for -o options
- *name* : displays the name of the *tree*.
- *init* : displays a boolean value of the initialization state.
- *enabled* : displays a boolean value of the enable state.
- *start* : displays the list of *tree*(s) started before.
- *current* : displays a boolean value of the current state.
- *allowed* : displays the list of allowed user to use the *tree*.
- *symlinks* : displays the target of *tree*'s symlinks.
- *contents* : displays the contents of the *tree*.
## Command and output examples
The command `66-intree boot`, run as root user, on [Obarun](https://web.obarun.org)'s default system displays the following where *boot* is the tree used to properly boot the machine:
```
Name : boot
Initialized : yes
Enabled : no
Starts after : None
Current : no
Allowed : root
Symlinks : svc->source db->source
Contents : tty12 system-hostname mount-run populate-run mount-tmp populate-tmp mount-proc mount-sys
populate-sys mount-dev mount-pts mount-shm populate-dev mount-cgroups 00 modules-kernel udevd
udevadm devices-crypttab system-hwclock system-random modules-system system-sysctl
system-fontnkey devices-dmraid devices-btrfs devices-lvm devices-zfs system-Devices mount-swap
all-Mount system-fsck mount-fstab all-System mount-rw local-iptables local-ip6tables local-loop
local-sethostname local-time local-authfiles local-tmpfiles local-rc local-dmesg all-Local
all-Runtime All
```
The field *name* gives you the name of the tree.
The field *Initialized* tells you if the tree was initialized with [66-init](66-init.html) tool.
The field *Enabled* reveals the state of the tree—see [66-tree -E](66-tree.html).
The field *Starts after* reveals the start process order if the *tree* is enabled, meaning which *tree* is started before the current one.
The field *Current* tells you if the tree is the current one or not—see [66-tree -c](66-tree.html).
The field *Allowed* gives you a list of user(s) allowed to handle the tree—see [66-tree -a|d](66-tree.html).
The field *Symlinks* tells you if the current live state point to the *source* or the *backup* of the *tree*. Every use of [66-enable](66-enable.html) tool create a automatic backup of the tree for `classic`,`bundle` or `atomic` service(s). A symlink pointing to *backup* mean that you have enabled a service without starting it. Right after a boot, each tree should point to *source*.
The field *Contents* gives you a list of all services enabled in the *tree*.
You can display the contents list as a graph and only these fields using the command `66-intree -o contents -g boot`:
```
Contents : /
├─(253,Enabled,classic) tty12
├─(0,Enabled,oneshot) system-hostname
├─(0,Enabled,oneshot) mount-run
├─(0,Enabled,oneshot) populate-run
├─(0,Enabled,oneshot) mount-tmp
├─(0,Enabled,oneshot) populate-tmp
├─(0,Enabled,oneshot) mount-proc
├─(0,Enabled,oneshot) mount-sys
├─(0,Enabled,oneshot) populate-sys
├─(0,Enabled,oneshot) mount-dev
├─(0,Enabled,oneshot) mount-pts
├─(0,Enabled,oneshot) mount-shm
├─(0,Enabled,oneshot) populate-dev
├─(0,Enabled,oneshot) mount-cgroups
├─(0,Enabled,bundle) 00
├─(0,Enabled,oneshot) modules-kernel
├─(485,Enabled,longrun) udevd
├─(0,Enabled,oneshot) udevadm
├─(0,Enabled,oneshot) devices-crypttab
├─(0,Enabled,oneshot) system-hwclock
├─(0,Enabled,oneshot) system-random
├─(0,Enabled,oneshot) modules-system
├─(0,Enabled,oneshot) system-sysctl
├─(0,Enabled,oneshot) system-fontnkey
├─(0,Enabled,oneshot) devices-dmraid
├─(0,Enabled,oneshot) devices-btrfs
├─(0,Enabled,oneshot) devices-lvm
├─(0,Enabled,oneshot) devices-zfs
├─(0,Enabled,bundle) system-Devices
├─(0,Enabled,oneshot) mount-swap
├─(0,Enabled,bundle) all-Mount
├─(0,Enabled,oneshot) system-fsck
├─(0,Enabled,oneshot) mount-fstab
├─(0,Enabled,bundle) all-System
├─(0,Enabled,oneshot) mount-rw
├─(0,Enabled,oneshot) local-iptables
├─(0,Enabled,oneshot) local-ip6tables
├─(0,Enabled,oneshot) local-loop
├─(0,Enabled,oneshot) local-sethostname
├─(0,Enabled,oneshot) local-time
├─(0,Enabled,oneshot) local-authfiles
├─(0,Enabled,oneshot) local-tmpfiles
├─(0,Enabled,oneshot) local-rc
├─(0,Enabled,oneshot) local-dmesg
├─(0,Enabled,bundle) all-Local
├─(0,Enabled,oneshot) all-Runtime
└─(0,Enabled,bundle) All
```
For each service the first field found between `()` parentheses is the corresponding pid of the service, the second one is the state of the service, and next to it is the type of the service, separated by commas, and finally the name of the service is displayed after the parenthesis `)`.
By default the dependency graph is rendered in the order of execution. In this example the `classic` *tty12* is the first executed service and `bundle` *All* is the last before it finishes. You can reverse the rendered order with the **-r** option.
You can display the name and current field and only these fields for each tree using the command `66-intree -o name,current`:
```
Name : boot
Current : no
Name : docker
Current : no
Name : root
Current : no
Name : test
Current : yes
Name : user
Current : no
```
title: The 66 Suite: status
author: Eric Vidal <eric@obarun.org>
[66](index.html)
[Software](https://web.obarun.org/software)
[obarun.org](https://web.obarun.org)
# status
This command displays information about services.
## Interface
```
status [ -h ] [ -n ] [ -o name,intree,status,... ] [ -g ] [ -d depth ] [ -r ] [ -p nline ] service
```
By default the dependency graph is rendered in the [start](start.html) order of execution. You can reverse the rendered order, meaning the [stop](stop.html) execution, with the `-r` option.
Without specifying the `-o`, all fields are displayed.
## Options
- **-h**: prints this help.
- **-n**: do not display the field name(s) specified. Combining this options with the `-o` facilitates scripting usage.
- **-o**: comma separated list of fields to display.
- **-g**: shows the dependency list of the *service* as a hierarchical graph instead of a list.
- **-d** *depth*: limits the depth of the dependency list visualisation; default is 1. This implies **-g** option.
- **-r**: shows the dependency list of *services* in reverse mode.
- **-p** *nline*: prints the *nline* last lines from the log file of the *service*. Default is 20.
## Valid fields for -o options
- **name**: displays the name.
- **version**: displays the version of the service.
- **intree**: displays the service's tree name.
- **status**: displays the status.
- **type**: displays the service type.
- **description**: displays the description.
- **partof**: displays the module name for services part of that module.
- **notify**: displays the number of the fd for readiness notification.
- **maxdeath**: displays the number of maximum death.
- **earlier**: displays if service is an earlier one.
- **source**: displays the source of the service's [frontend](frontend.html) file.
- **live**: displays the service's live directory.
- **depends**: displays the service's dependencies.
- **requiredby**: displays the service(s) which depends on service.
- **contents**: displays services within module.
- **optsdepends**: displays the service's optional dependencies. Also displays the name of the associated *tree* of the optional dependencies after the `colon(:)` mark if any.
- **start**: displays the service's start script.
- **stop**: displays the service's stop script.
- **envat**: displays the source of the environment file.
- **envfile**: displays the contents of the environment file.
- **logname**: displays the logger's name.
- **logdst**: displays the logger's destination.
- **logfile**: displays the contents of the log file.
## Usage examples
Displays all information of service `foo`
```
66 status foo
```
Only displays the field `name` and `status` of service `foo`
```
66 status -o name,status foo
```
Also, do not display the name of the field `name` and `status` of service `foo`
```
66 status -no name,status foo
```
Only displays the contents of the log file of the service `foo`
```
66 status -o logfile foo
```
Also, displays the last 100 lines of the log file of the service `foo`
```
66 status -o logfile -p100 foo
```
In a script you can do
```
#!/bin/sh
service="${1}"
type=$(66 status -no type ${service})
if [ ${type} = "classic" ]; then
echo ${service} is a classic service
else if [ ${type} = "module" ]; then
echo ${service} is a module service
else if [ ${type} = "oneshot" ]; then
echo ${service} is a oneshot service
fi
```
Displays information of the service using the graph mode
```
66 status -g dbus
Name : dbus
Version : 0.0.1
In tree : global
Status : enabled, up (pid 731) 34829 seconds, ready 34829 seconds
Type : classic
Description : dbus system daemon
Part of : None
Notify : 4
Max death : 3
Earlier : 0
Source : /etc/66/service/dbus
Live : /run/66/scandir/0/dbus
Dependencies : \
└─dbus-log (pid=723, state=Enabled, type=classic, tree=global)
Required by : \
├─networkmanager (pid=747, state=Enabled, type=classic, tree=global)
├─boot-user@oblive (pid=up, state=Enabled, type=module, tree=session)
└─consolekit (pid=746, state=Enabled, type=classic, tree=global)
Contents : \
└─None
Optional dependencies : None
Start script :
#!/usr/bin/execlineb -P
fdmove -c 2 1
execl-envfile -v4 /etc/66/conf/dbus/version
execl-toc -S ${socket_name} -m 0755
foreground {
execl-toc -d /var/lib/dbus
dbus-uuidgen --ensure
}
execl-cmdline -s { dbus-daemon ${cmd_args} }
Stop script :
#!/usr/bin/execlineb -P
fdmove -c 2 1
execl-envfile -v4 /etc/66/conf/dbus/version
s6-rmrf ${socket_name}
Environment source : /etc/66/conf/dbus/0.0.1
Environment file : environment variables from: /etc/66/conf/dbus/0.0.1/.dbus
cmd_args=!--system --print-pid=4 --nofork --nopidfile --address=unix:path=${socket_name}
socket_name=!/run/dbus/system_bus_socket
environment variables from: /etc/66/conf/dbus/0.0.1/dbus
cmd_args=!--system --print-pid=4 --nofork --nopidfile --address=unix:path=${socket_name}
socket_name=!/run/dbus/system_bus_socket
Log name : dbus-log
Log destination : /var/log/66/dbus
Log file :
dbus-daemon[731]: [system] Activating service name='org.freedesktop.nm_dispatcher' requested by ':1.2' (uid=0 pid=747 comm="NetworkManager -d") (using servicehelper)
dbus-daemon[731]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
dbus-daemon[731]: [system] Activating service name='org.freedesktop.nm_dispatcher' requested by ':1.2' (uid=0 pid=747 comm="NetworkManager -d") (using servicehelper)
dbus-daemon[731]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
dbus-daemon[731]: [system] Activating service name='org.freedesktop.nm_dispatcher' requested by ':1.2' (uid=0 pid=747 comm="NetworkManager -d") (using servicehelper)
dbus-daemon[731]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
dbus-daemon[731]: [system] Activating service name='org.freedesktop.nm_dispatcher' requested by ':1.2' (uid=0 pid=747 comm="NetworkManager -d") (using servicehelper)
dbus-daemon[731]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
dbus-daemon[731]: [system] Activating service name='org.freedesktop.nm_dispatcher' requested by ':1.2' (uid=0 pid=747 comm="NetworkManager -d") (using servicehelper)
dbus-daemon[731]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
dbus-daemon[731]: [system] Activating service name='org.freedesktop.nm_dispatcher' requested by ':1.2' (uid=0 pid=747 comm="NetworkManager -d") (using servicehelper)
dbus-daemon[731]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
dbus-daemon[731]: [system] Activating service name='org.freedesktop.nm_dispatcher' requested by ':1.2' (uid=0 pid=747 comm="NetworkManager -d") (using servicehelper)
dbus-daemon[731]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
dbus-daemon[731]: [system] Activating service name='org.freedesktop.nm_dispatcher' requested by ':1.2' (uid=0 pid=747 comm="NetworkManager -d") (using servicehelper)
dbus-daemon[731]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
dbus-daemon[731]: [system] Activating service name='org.freedesktop.nm_dispatcher' requested by ':1.2' (uid=0 pid=747 comm="NetworkManager -d") (using servicehelper)
dbus-daemon[731]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
dbus-daemon[731]: [system] Activating service name='org.freedesktop.nm_dispatcher' requested by ':1.2' (uid=0 pid=747 comm="NetworkManager -d") (using servicehelper)
dbus-daemon[731]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
```
\ No newline at end of file
......@@ -327,7 +327,7 @@ In a script you can do
#!/bin/sh
tree="${1}"
isenabled=$(66 tree status -no ${tree})
isenabled=$(66 tree status -no enabled ${tree})
if [ ${isenabled} = "no" ]; then
echo ${tree} is not enabled
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment