Systemd-control
From SME Server
systemd-control logo | |
Maintainer | John Crisp |
---|---|
Url | https://wiki.koozali.org |
Licence | GPL v2 |
Category | |
Tags | contrib'developer, perl |
Maintainer
Version
Description
Manage systemd services via perl.
Shamelessly copied from Nethesis.
This module adds some systemd checks and commands for services https://github.com/NethServer/nethserver-lib/blob/master/lib/perl/NethServer/Service.pm https://raw.githubusercontent.com/NethServer/nethserver-lib/master/lib/perl/NethServer/Service.pm
Installation
yum --enablerepo=smecontribs install smeserver-systemd-control
Not available
Configuration
There are no configuration entries
This module provides the following functions:
- new
- start
- stop
- condrestart
- restart
- reload
- is_configured
- is_enabled
- is_owned
- is_running
- is_masked
- adjust
- get_name
Test file is here:
/usr/local/bin/systemdcontrol-test.pl
Sample code:
my $servicename = "php55-php-fpm"; # Create specific object my $systemd1 = new esmith::Service($servicename); my $result1 = $systemd1->is_running(); if ( $result1 == 1 ) { print "Result 1 running $result1\n"; } else { print "Result 1 failed $result1\n"; }
# Create non-specific object and set servicename later my $systemd2 = new esmith::Service(); $servicename = "sshd"; $systemd2->{'serviceName'} = $servicename; $systemd2->{'verbose'} = 1; my $result2 = $systemd2->is_running(); if ( $result2 == 1 ) { print "Result 2 running $result2\n"; } else { print "Result 2 failed $result2\n"; } # So then we can do # (is_configured && is_enabled) do something eg restart
Uninstall
yum remove smeserver-systemd-control
Bugs
Please raise bugs under the SME-Contribs section in bugzilla
and select the smeserver-systemd-control component or use this link
Below is an overview of the current issues for this contrib:
No open bugs found.
Changelog
Only released version in smecontrib are listed here.
smeserver-systemd-control Changelog: SME 10 (smecontribs)
2022/06/07 John Crisp 0.1-2.sme
- Force update to Description with new release [SME: 11064]
- Force update to Description with new release [SME: 11064]
2021/09/21 John Crisp 0.1-2.sme
- Updated description [SME: 11064]
- Updated description [SME: 11064]
2020/10/14 John Crisp 0.1-1.sme
- Initial build [SME: 11064]
- Initial build [SME: 11064]