svc

Управљање сервисима
git clone https://git.sr.ht/~strahinja/svc
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

service.8 (2962B)


      1 .Dd April 17, 2023
      2 .Dt SERVICE 8 SMM
      3 .Os Galeb 2.2
      4 .Sh NAME
      5 .Nm service
      6 .Nd manage services
      7 .Sh SYNOPSIS
      8 .Nm
      9 .Op Ar operation
     10 .Op Ar service | Cm all
     11 .Sh DESCRIPTION
     12 Most of the options accept either the service name or the special keyword
     13 .Dq Cm all ,
     14 which applies the operation to all the related services.
     15 .Pp
     16 Operation names can be abbreviated to the shortest distinctive form, eg. instead
     17 of
     18 .Cm activated ,
     19 one can use
     20 .Cm ad ,
     21 but not
     22 .Cm act ,
     23 as that is the abbreviation for
     24 .Cm activate .
     25 The parts which can be omitted are given here in brackets.
     26 .
     27 .Bl -tag -width ".Nm Fl a" -offset indent
     28 .
     29 .It Nm Cm a(ctivate) Op Ar service | Cm all
     30 activates the service
     31 .Dq Ar service .
     32 .
     33 .It Nm Cm a(ctivate)d Op Ar service | Cm all
     34 checks if the service
     35 .Dq Ar service
     36 is activated in
     37 .Pa /bin/svc.d/run .
     38 .
     39 .It Nm Cm d(eactivate) Op Ar service | Cm all
     40 deactivates the service
     41 .Dq Ar service .
     42 .
     43 .It Nm Cm l(ist)
     44 lists all available (not necessarily activated) services in the directory
     45 .Pa /bin/svc.d/avail .
     46 .
     47 .It Nm Cm re(start) Op Ar service | Cm all
     48 restarts the service.
     49 .
     50 .It Nm Cm ru(nning) Op Ar service | Cm all
     51 checks if the service
     52 .Dq Ar service
     53 is running.
     54 .
     55 .It Nm Cm sta(rt) Op Ar service | Cm all
     56 starts the service.
     57 .
     58 .It Nm Cm sto(p) Op Ar service | Cm all
     59 stops the service.
     60 .El
     61 .Sh ENVIRONMENT
     62 .Bl -tag -width ".Ev STATUSDELAY"
     63 .It Ev STATUSDELAY
     64 Delay between issuing
     65 .Ql service start all
     66 and
     67 .Ql service running all ,
     68 in seconds.
     69 Default value is 1.
     70 Adjust as necessary to leave time for services to start before querying their
     71 status.
     72 .El
     73 .Sh FILES
     74 .Bl -tag -width ".Pa /bin/svc.d/avail"
     75 .It Pa /bin/svc.d/avail
     76 service scripts which are available for activation.
     77 .It Pa /bin/svc.d/default
     78 service configuration files.
     79 .It Pa /bin/svc.d/run
     80 symlinks to activated service scripts.
     81 .El
     82 .Sh STATUS ABBREVIATIONS
     83 When outputting service status, various four-letter-maximum abbreviations will
     84 be printed on the right:
     85 .Bl -tag -offset indent -width 6n
     86 .It OK
     87 the operation was successful.
     88 .It FAIL
     89 the operation has failed.
     90 .It YE
     91 the service is running.
     92 .It NO
     93 the service isn't running.
     94 .It 1-ST
     95 the service is
     96 .Dq one-shot ,
     97 so the
     98 .Cm running
     99 operation doesn't apply.
    100 .It RNNG
    101 the service is already running.
    102 .It NOTR
    103 the service already isn't running.
    104 .El
    105 .Sh EXIT STATUS
    106 .Xr svc 8 ,
    107 .Nm
    108 and service scripts themselves should set the exit status to one of the
    109 following:
    110 .Bl -tag -offset indent -width 6n
    111 .It 0
    112 success.
    113 .
    114 .It 1
    115 redundancy; for example, if starting the service was attempted when the service
    116 is already running.
    117 .
    118 .It 2
    119 general error.
    120 .El
    121 .Sh SEE ALSO
    122 .Xr svc 8
    123 .Sh HISTORY
    124 .Xr svc 8
    125 and related commands were made by Cristoph Lohmann in 2012.
    126 The version used in Galeb is heavily modified and documented by Strahinya Radich
    127 in 2022.
    128 .Sh AUTHORS
    129 .An "Cristoph Lohmann" Aq 20h@r-36.net ,
    130 2012-2014, original author
    131 .An "Strahinya Radich" Aq contact@strahinja.org ,
    132 2022, reorganized
    133 .Xr svc 8
    134 and created the manpage.