mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Fixed indenting... got messed up somehow...
This commit is contained in:
parent
246f75f2dd
commit
c70e182cdf
@ -455,111 +455,111 @@ def config(name,
|
||||
obj=None,
|
||||
password=None,
|
||||
**kwargs):
|
||||
r'''
|
||||
Modify the named service.
|
||||
r'''
|
||||
Modify the named service.
|
||||
|
||||
.. versionadded:: 2015.8.5
|
||||
.. versionadded:: 2015.8.5
|
||||
|
||||
Required parameters:
|
||||
Required parameters:
|
||||
|
||||
:param str name: Specifies the service name returned by the getkeyname
|
||||
operation
|
||||
:param str name: Specifies the service name returned by the getkeyname
|
||||
operation
|
||||
|
||||
|
||||
Optional parameters:
|
||||
Optional parameters:
|
||||
|
||||
:param str bin_path: Specifies the path to the service binary file,
|
||||
backslashes must be escaped
|
||||
- eg: C:\\path\\to\\binary.exe
|
||||
:param str bin_path: Specifies the path to the service binary file,
|
||||
backslashes must be escaped
|
||||
- eg: C:\\path\\to\\binary.exe
|
||||
|
||||
:param str display_name: the name to be displayed in the service manager
|
||||
Specifies a more descriptive name for identifying the service in user
|
||||
interface programs.
|
||||
:param str display_name: the name to be displayed in the service manager
|
||||
Specifies a more descriptive name for identifying the service in user
|
||||
interface programs.
|
||||
|
||||
:param str svc_type: Specifies the service type. Acceptable values are:
|
||||
- own (default): Service runs in its own process
|
||||
- share: Service runs as a shared process
|
||||
- interact: Service can interact with the desktop
|
||||
- kernel: Service is a driver
|
||||
- filesys: Service is a system driver
|
||||
- rec: Service is a file system-recognized driver that identifies
|
||||
filesystems on the computer
|
||||
- adapt: Service is an adapter driver that identifies hardware such as
|
||||
keyboards, mice and disk drives
|
||||
:param str svc_type: Specifies the service type. Acceptable values are:
|
||||
- own (default): Service runs in its own process
|
||||
- share: Service runs as a shared process
|
||||
- interact: Service can interact with the desktop
|
||||
- kernel: Service is a driver
|
||||
- filesys: Service is a system driver
|
||||
- rec: Service is a file system-recognized driver that identifies
|
||||
filesystems on the computer
|
||||
- adapt: Service is an adapter driver that identifies hardware such as
|
||||
keyboards, mice and disk drives
|
||||
|
||||
:param str start_type: Specifies the start type for the service.
|
||||
Acceptable values are:
|
||||
- boot: Device driver that is loaded by the boot loader
|
||||
- system: Device driver that is started during kernel initialization
|
||||
- auto: Service that automatically starts
|
||||
- demand (default): Service must be started manually
|
||||
- disabled: Service cannot be started
|
||||
- delayed-auto: Service starts automatically after other auto-services
|
||||
start
|
||||
:param str start_type: Specifies the start type for the service.
|
||||
Acceptable values are:
|
||||
- boot: Device driver that is loaded by the boot loader
|
||||
- system: Device driver that is started during kernel initialization
|
||||
- auto: Service that automatically starts
|
||||
- demand (default): Service must be started manually
|
||||
- disabled: Service cannot be started
|
||||
- delayed-auto: Service starts automatically after other auto-services
|
||||
start
|
||||
|
||||
:param str error: Specifies the severity of the error if the service
|
||||
fails to start. Acceptable values are:
|
||||
- normal (default): Error is logged and a message box is displayed
|
||||
- severe: Error is logged and computer attempts a restart with last
|
||||
known good configuration
|
||||
- critical: Error is logged, computer attempts to restart with last
|
||||
known good configuration, system halts on failure
|
||||
- ignore: Error is logged and startup continues, no notification is
|
||||
given to the user
|
||||
:param str error: Specifies the severity of the error if the service
|
||||
fails to start. Acceptable values are:
|
||||
- normal (default): Error is logged and a message box is displayed
|
||||
- severe: Error is logged and computer attempts a restart with last known
|
||||
good configuration
|
||||
- critical: Error is logged, computer attempts to restart with last known
|
||||
good configuration, system halts on failure
|
||||
- ignore: Error is logged and startup continues, no notification is given
|
||||
to the user
|
||||
|
||||
:param str group: Specifies the name of the group of which this service
|
||||
is a member. The list of groups is stored in the registry, in the
|
||||
HKLM\System\CurrentControlSet\Control\ServiceGroupOrder subkey. The
|
||||
default is null.
|
||||
:param str group: Specifies the name of the group of which this service is a
|
||||
member. The list of groups is stored in the registry, in the
|
||||
HKLM\System\CurrentControlSet\Control\ServiceGroupOrder subkey. The default
|
||||
is null.
|
||||
|
||||
:param str tag: Specifies whether or not to obtain a TagID from the
|
||||
CreateService call. For boot-start and system-start drivers only.
|
||||
Acceptable values are:
|
||||
- yes/no
|
||||
:param str tag: Specifies whether or not to obtain a TagID from the
|
||||
CreateService call. For boot-start and system-start drivers only.
|
||||
Acceptable values are:
|
||||
- yes/no
|
||||
|
||||
:param str depend: Specifies the names of services or groups that must
|
||||
start before this service. The names are separated by forward slashes.
|
||||
:param str depend: Specifies the names of services or groups that must start
|
||||
before this service. The names are separated by forward slashes.
|
||||
|
||||
:param str obj: Specifies th name of an account in which a service will
|
||||
run or specifies a name of the Windows driver object in which the driver
|
||||
will run. Default is LocalSystem
|
||||
:param str obj: Specifies th name of an account in which a service will run
|
||||
or specifies a name of the Windows driver object in which the driver will
|
||||
run. Default is LocalSystem
|
||||
|
||||
:param str password: Specifies a password. Required if other than
|
||||
LocalSystem account is used.
|
||||
:param str password: Specifies a password. Required if other than
|
||||
LocalSystem account is used.
|
||||
|
||||
:return: True if successful, False if not
|
||||
:rtype: bool
|
||||
:return: True if successful, False if not
|
||||
:rtype: bool
|
||||
|
||||
CLI Example:
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' service.config <service name> <path to exe> display_name='<display name>'
|
||||
'''
|
||||
salt '*' service.config <service name> <path to exe> display_name='<display name>'
|
||||
'''
|
||||
|
||||
cmd = ['sc', 'config', name]
|
||||
if bin_path is not None:
|
||||
cmd.extend(['binpath=', bin_path])
|
||||
if svc_type is not None:
|
||||
cmd.extend(['type=', svc_type])
|
||||
if start_type is not None:
|
||||
cmd.extend(['start=', start_type])
|
||||
if error is not None:
|
||||
cmd.extend(['error=', error])
|
||||
if display_name is not None:
|
||||
cmd.extend(['DisplayName=', display_name])
|
||||
if group is not None:
|
||||
cmd.extend(['group=', group])
|
||||
if tag is not None:
|
||||
cmd.extend(['tag=', tag])
|
||||
if depend is not None:
|
||||
cmd.extend(['depend=', depend])
|
||||
if obj is not None:
|
||||
cmd.extend(['obj=', obj])
|
||||
if password is not None:
|
||||
cmd.extend(['password=', password])
|
||||
cmd = ['sc', 'config', name]
|
||||
if bin_path is not None:
|
||||
cmd.extend(['binpath=', bin_path])
|
||||
if svc_type is not None:
|
||||
cmd.extend(['type=', svc_type])
|
||||
if start_type is not None:
|
||||
cmd.extend(['start=', start_type])
|
||||
if error is not None:
|
||||
cmd.extend(['error=', error])
|
||||
if display_name is not None:
|
||||
cmd.extend(['DisplayName=', display_name])
|
||||
if group is not None:
|
||||
cmd.extend(['group=', group])
|
||||
if tag is not None:
|
||||
cmd.extend(['tag=', tag])
|
||||
if depend is not None:
|
||||
cmd.extend(['depend=', depend])
|
||||
if obj is not None:
|
||||
cmd.extend(['obj=', obj])
|
||||
if password is not None:
|
||||
cmd.extend(['password=', password])
|
||||
|
||||
return not __salt__['cmd.retcode'](cmd, python_shell=False)
|
||||
return not __salt__['cmd.retcode'](cmd, python_shell=False)
|
||||
|
||||
|
||||
def delete(name):
|
||||
|
Loading…
Reference in New Issue
Block a user