1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

added sysv functions

This commit is contained in:
Brian Coca 2016-11-10 23:58:28 -05:00
parent ac8842eee8
commit c880c1a78d

View file

@ -27,4 +27,24 @@
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# This file is a placeholder for common code for the future split 'service' modules.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import glob
def sysv_is_enabled(name):
return bool(glob.glob('/etc/rc?.d/S??%s' % name))
def get_sysv_script(name):
if name.startswith('/'):
result = name
else:
result = '/etc/init.d/%s' % name
return result
def sysv_exists(name):
return os.path.exists(get_sysv_script(name))