Closed pillarsdotnet closed 5 years ago
Considered relying on camptocamp/puppet-systemd to tell whether systemd is running, but its test fails on AmazonLinux:
[root@ip-10-254-250-45 ~]# ps -p 1 -o comm=
init
I have never used amazon linux. I'm not sure if it has systemd, but if its based off of RedHat 7, it should. DO you have epel configured? I think those packages come from epel on CentOS
You can set the name of the package to fix it for now:
class { 'clamav':
manage_clamd => true,
clamav_package => 'clamav-scanner-sysvinit',
}
This test succeeds:
[root@ip-10-254-250-45 ~]# if /proc/1/exe --version | grep -q 'systemd' ; then echo "Init is systemd" ; else echo "Init is NOT systemd" ; fi
Init is NOT systemd
On a standard sysvinit system, /proc/1/exe --version
outputs the following:
[root@ip-10-254-250-239 ~]# /proc/1/exe --version
/proc/1/exe: invalid option -- -
Usage: exe 0123456SsQqAaBbCcUu
On an upstart-based system, /proc/1/exe --version
outputs the following:
[root@ip-10-254-250-45 ~]# /proc/1/exe --version
exe (upstart 0.6.5)
Copyright (C) 2010 Canonical Ltd.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
On a systemd-based system, /proc/1/exe --version
output the following:
systemd 233
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN default-hierarchy=hybrid
So it seems like you have systemd. Just missing the package.
whats the output of:
yum info clamav-scanner-sysvinit
What repo are those packages coming from?
Wait maybe I misunderstood. Do you have systemd?
AmazonLinux 2017.03 does not appear to have systemd:
[root@ip-10-254-250-45 ~]# cat /cat /etc/os-release
cat: /cat: No such file or directory
NAME="Amazon Linux AMI"
VERSION="2017.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2017.03"
PRETTY_NAME="Amazon Linux AMI 2017.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2017.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
[root@ip-10-254-250-45 ~]# yum search systemd
Loaded plugins: priorities, update-motd, upgrade-helper
2012 packages excluded due to repository priority protections
============================================================================ N/S matched: systemd ============================================================================
golang-github-coreos-go-systemd-devel.noarch : Go bindings to systemd socket activation, journal and D-BUS APIs
golang-github-coreos-go-systemd-unit-test.x86_64 : Unit tests for golang-github-coreos-go-systemd package
golang-github-coreos-go-etcd-devel.i686 : A golang library for logging to systemd
golang-github-coreos-go-etcd-devel.x86_64 : A golang library for logging to systemd
golang-github-coreos-go-log-devel.noarch : A golang library for logging to systemd
golang-github-mitchellh-goamz-devel.i686 : A golang library for logging to systemd
golang-github-mitchellh-goamz-devel.x86_64 : A golang library for logging to systemd
Name and summary matches only, use "search all" for everything.
As requested:
[root@ip-10-254-250-45 ~]# yum info clamav-scanner-sysvinit
Loaded plugins: priorities, update-motd, upgrade-helper
2012 packages excluded due to repository priority protections
Available Packages
Name : clamav-scanner-sysvinit
Arch : noarch
Version : 0.99.2
Release : 1.27.amzn1
Size : 23 k
Repo : amzn-main/latest
Summary : SysV initscripts for clamav scanner daemon
URL : http://www.clamav.net
License : GPLv2
Description : The SysV initscripts for clamav-scanner.
Looks like the "meta" package is "clamd".
===============================================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================================
Installing:
clamd x86_64 0.99.2-1.27.amzn1 amzn-main 21 k
Installing for dependencies:
clamav x86_64 0.99.2-1.27.amzn1 amzn-main 1.0 M
clamav-data noarch 0.99.2-1.27.amzn1 amzn-main 111 M
clamav-filesystem noarch 0.99.2-1.27.amzn1 amzn-main 22 k
clamav-lib x86_64 0.99.2-1.27.amzn1 amzn-main 4.3 M
clamav-scanner noarch 0.99.2-1.27.amzn1 amzn-main 29 k
clamav-scanner-sysvinit noarch 0.99.2-1.27.amzn1 amzn-main 23 k
clamav-server x86_64 0.99.2-1.27.amzn1 amzn-main 112 k
clamav-server-sysvinit noarch 0.99.2-1.27.amzn1 amzn-main 23 k
Transaction Summary
===============================================================================================================================================================
Install 1 Package (+8 Dependent packages)
SO the code snippet I posted above should work for you...
class { 'clamav':
manage_clamd => true,
clamav_package => 'clamav-scanner-sysvinit',
}
Opened #38
Debian issue for systemd pid file: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804132