tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

service(8): post commit feedback solicited



[I know, this should have done _before_ putting it into the tree.]

So the question is: Does someone have strong arguments against
having this shell script to manage the rc scripts? FreeBSD has it
since version 7 and it has not changed much during those years. It
actually has more bells and whistles (i.e. higher TCO). Most linuxes
have something similar. In sum, most admins expect service to manage
the startup scripts.

Our version honors the $rc_directories variable and takes the -e
(enabled) and -l (list all) options.

$ service
usage: service [-elv]
       service [-ev] rc_script_name [rc_script_name2 [...]]
       service [-v] rc_script_name action
       -e: List enabled scripts; check if given scripts are enabled
       -l: List all scripts in rcorder
       -v: Verbose (mention in which directory script is found)
rc_directories is currently set to /etc/rc.d

$ man service

NAME
     service — run or list system services

SYNOPSIS
     service [−elv]
     service [−ev] rc_script_name [rc_script_name2 [...]]
     service [−v] rc_script_name action

DESCRIPTION
     The service command is a simple interface to the services startup system.

     Its purpose is to list the services or invoke actions on them as provided
     by the rc.d scripts.  When used to invoke rc.d scripts, service will set
     the same environment that is used at boot time.

     The following options are supported:

     −e  List services that are enabled.  The list of scripts is compiled
         using rcorder(8) the same way as is done in rc(8); each script is
         first checked for an "rcvar" assignment and if present, checked to
         see if it is enabled.  If one or more rc_script_name are specified,
         only those are checked.  The rc_script_name arguments are always
         specified without a path prefix.

     −l  List all files in /etc/rc.d (the default of rc_directories as defined
         in rc.conf(5)).  A script will be listed unless it has the "nostart"
         keyword enabled.

     −v  Report what rc_directories are defined or in which directory the rc.d
         script was found when an action is invoked.

ENVIRONMENT
     When used to invoke rc.d scripts, the service command sets umask to 022,
     HOME to /, and PATH to /sbin:/bin:/usr/sbin:/usr/bin which is how they
     are set in /etc/rc at boot time.  The action is typically one of start,
     restart, status, or any other argument supported by the rc_script_name.

EXIT STATUS
     The service utility exits 0 on success, and >0 if an error occurs.

EXAMPLES
     These are typical usages of the service command:

           # service sshd restart
           Stopping sshd.
           Starting sshd.

           $ service ‐v inetd status
           inetd is located in /etc/rc.d
           inetd is running as pid 1713.

           $ service ‐ve ccd motd hostapd my_pkg
           rc_directories is /etc/rc.d /usr/pkg/etc/rc.d
           /etc/rc.d/ccd
           /usr/pkg/etc/rc.d/my_pkg
           /etc/rc.d/motd

     In the last example, hostapd(8) was apparently left disabled and the
     additional directory /usr/pkg/etc/rc.d was configured by redefining the
     variable rc_directories in rc.conf; further, my_pkg=yes must have also
     been set.


Feedback here or private,
Thanks

PS Yes, I jave already submitted a pullup-7 request and will also
remove the -f option as shown in the manual page above.



Home | Main Index | Thread Index | Old Index