diff --git a/apache/files/httpsd.service b/apache/files/httpsd.service new file mode 100644 index 0000000..5f665e9 --- /dev/null +++ b/apache/files/httpsd.service @@ -0,0 +1,15 @@ +[Unit] +Description=The Apache HTTP Server (prefork MPM) +After=syslog.target network.target remote-fs.target nss-lookup.target + +[Service] +Type=forking +PIDFile=/var/run/httpd/httpsd.pid +EnvironmentFile=/etc/sysconfig/httpsd +ExecStart=/usr/sbin/httpsd -f /etc/httpd/conf/httpsd.conf $OPTIONS -k start +ExecReload=/usr/sbin/httpsd -f /etc/httpd/conf/httpsd.conf $OPTIONS -t +ExecReload=/bin/kill -HUP $MAINPID +ExecStop=/usr/sbin/httpsd -f /etc/httpd/conf/httpsd.conf $OPTIONS -k stop + +[Install] +WantedBy=multi-user.target diff --git a/apache/manifests/redhat.pp b/apache/manifests/redhat.pp index 1b72443..ef683fe 100644 --- a/apache/manifests/redhat.pp +++ b/apache/manifests/redhat.pp @@ -150,12 +150,27 @@ class apache::redhat::sslserver { notify => Service["httpsd"], } - file { "/etc/init.d/httpsd": - ensure => present, - source => "puppet:///modules/apache/httpsd", - mode => "0755", - owner => root, - group => root, + case $operatingsystem { + "fedora": { + file { "/lib/systemd/system/httpsd.service": + ensure => present, + source => "puppet:///modules/apache/httpsd.service", + mode => "0644", + owner => "root", + group => "root", + before => Service["httpsd"], + } + } + default: { + file { "/etc/init.d/httpsd": + ensure => present, + source => "puppet:///modules/apache/httpsd", + mode => "0755", + owner => "root", + group => "root", + before => Service["httpsd"], + } + } } file { "/usr/sbin/httpsd": @@ -174,7 +189,6 @@ class apache::redhat::sslserver { require => [ Package["httpd"], Package["mod_ssl"], File["/etc/httpd/conf/httpsd.conf"], - File["/etc/init.d/httpsd"], File["/usr/sbin/httpsd"], ], }