summaryrefslogtreecommitdiff
path: root/smf-tools/debian/svcstatus.pod
blob: 112b7a95613f8b4405aa251a45fe2576d418a82b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
=pod

=head1 NAME

svcstatus prints status of a given SMF service

=head1 SYNOPSIS

    $ svcstatus sudo
    online
    $ svcstatus foo 
    none
    $ svcstatus system/dbus
    online
    $ sudo svcadm disable -t dbus
    $ svcstatus dbus
    temporary-disabled


    if [ `svcstatus application/database/mysql` = online ]; then
        svcadm restart application/database/mysql || true
    fi


=head1 DESCRIPTION

C<svcstatus> prints the status of a given SMF service. The service should be fully qualified
(full FMRI like C<svc:/system/dbus:default>), otherwise result is undefined.

In contrast to L<svcs(1)>, this utility is always successful (returns 0) and designed to be used
in L<dpkg(1)> maintainer scripts for starting, stopping or restarting a service on package upgrade
or removal.

=head1 OUTPUT

The output of this program is a lower-case word expressing the service state as described in L<smf(5)/STATES>
with this additions:

=over 4

=item temporary-disabled

The service is enabled, but is not running. That means that the service was temporary disabled by
C<svcadm disable -t FMRI>.

=item none

The state of the service is unknown. The reasons for this may be: the service does not exist,
the FMRI is not fully qualified (matches multiple services), SMF system is not online - see L<smf_present(1)>.

=back

=head1 SEE ALSO

L<smf(5)>, L<svc.configd(1M)>, L<svc.startd(1M)>, L<svcadm(1M)>,
L<svccfg(1M)>, L<svcprop(1)>, L<smf_present(1)>, L<svcs(1)>.

=cut