Systemd-control
| systemd-control logo | |
| Maintainer | John Crisp |
|---|---|
| Url | https://wiki.koozali.org |
| Source: | smeserver-systemd-control |
| 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
dnf install smeserver-systemd-control
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:
Changelog
Only released version in smecontrib are listed here.
- Make sure rpm has .el8.sme in name [SME: 13275]
- Fix e-smith references in smeserver-systemd-control [SME: 12732]
- Roll up patches and move to git repo [SME: 12338]
2024/09/07 BogusDateBot
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
- Force update to Description with new release [SME: 11064]
- Force update to Description with new release [SME: 11064]
- Updated description [SME: 11064]
- Initial build [SME: 11064]