Submitted by yngens on Sun, 08/02/2015 - 22:57
Everyday our CentOS 7.x customer servers send the error messages with the title "Anacron job 'cron.daily' on ns1.host.tld" and content:
/etc/cron.daily/logrotate:
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Troubleshooting this issue, I looked high and low and I have a guess this issue might be caused by an obsolete command in /etc/webmin/apache/config file:
apply_cmd=service httpd graceful
If you run this command in CLI then it gives:
service httpd graceful
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Even if these issues are not related, this particular command must be removed or replaced by some other legitimate command like, for example:
apachectl graceful
Thanks!
Status:
Active
Comments
Submitted by andreychek on Sun, 08/02/2015 - 23:03 Comment #1
Howdy -- take a peek in Webmin -> Servers -> Apache -> Module Config -> System Configuration.
There, what is "Command to apply configuration" set to?
Also, did you perhaps migrate to this server from an older one? Or is this a fresh install and a fresh Webmin/Virtualmin configuration?
Submitted by yngens on Mon, 08/03/2015 - 19:22 Comment #2
As the screenshot shows it is "service httpd graceful". What option or exact command should be here for RHEL 7.x based Virtualmin systems?
The server is a fresh CentOS 7.x install, but Virtualmin configuration was copied from another server. Anyway, even if this setting came from Virtualmin configuration backup file, there should be a check somewhere in the middle to verify the RHEL version and replace the faulty command.
Submitted by andreychek on Mon, 08/03/2015 - 19:57 Comment #3
Try setting that to the following:
apache2ctl graceful
That will only affect new Virtual Servers though; the command located in /etc/logrotate.conf would need to be manually updated.
Submitted by yngens on Tue, 08/04/2015 - 01:39 Comment #4
Just so you know, the "apache2ctl graceful" command didn't work on CentOS 7.x, but the "apachectl graceful" did.
root@centos7:/root# apache2ctl graceful -bash: apache2ctl: command not found root@centos7:/root# apachectl graceful
Submitted by yngens on Sun, 08/16/2015 - 10:09 Comment #5
Anyway, my original request was to update the obsolete command in /etc/webmin/apache/config for RHEL 7.x systems. So maybe we need to get the following three commands:
stop_cmd=service httpd stop
start_cmd=service httpd start
apply_cmd=service httpd graceful
replaced respectively by:
stop_cmd=systemctl stop httpd
start_cmd=systemctl start httpd
apply_cmd=apachectl graceful
?
Submitted by andreychek on Tue, 08/04/2015 - 08:51 Comment #6
Yes, those commands you're showing there are the correct ones for the start and stop commands.
I suspect those are settings that were pulled in from your old server, though I'll double-check on a test system here that a newly installed CentOS 7 system is using the correct commands.
Submitted by yngens on Sun, 08/16/2015 - 11:57 Comment #7
Here is the content of freshly installed CentOS 7.x Virtualmin system:
test_manual=0
show_list=1
mime_types=/etc/mime.types
auto_mods=1
stop_cmd=service httpd stop
pid_file=/run/httpd/httpd.pid
test_apachectl=1
max_servers=100
httpd_dir=/etc/httpd
start_cmd=service httpd start
show_order=0
test_always=0
apachectl_path=/usr/sbin/apachectl
show_names=0
test_config=1
apply_cmd=service httpd reload
httpd_path=/usr/sbin/httpd
allow_virtualmin=0
So please make sure to replace the commands as suggested above. The "service httpd reload" command for the "apply_cmd" option could be replaced with
systemctl reload httpd
instead ofapachectl graceful
, but I am not sure which one is more appropriate.Submitted by JamieCameron on Sun, 08/16/2015 - 16:02 Comment #8
Good suggestion .. I will do this for new installs in the next Webmin release.
Submitted by Issues on Sun, 08/30/2015 - 16:02 Comment #9
Automatically closed -- issue fixed for 2 weeks with no activity.
Submitted by yngens on Tue, 09/29/2015 - 09:40 Comment #10
Please note "apply_cmd" should be equal to
systemctl reload httpd
and notapachectl graceful
otherwise Anacron keeps sending the following message:/etc/cron.daily/logrotate:
Redirecting to /bin/systemctl reload httpd.service
Redirecting to /bin/systemctl reload httpd.service
Submitted by JamieCameron on Tue, 09/29/2015 - 18:35 Comment #11
What happens if you run
apachectl graceful
on your system?Submitted by yngens on Wed, 09/30/2015 - 11:34 Comment #12
It executes without without any warnings, however if
apachectl graceful
is left in the Webmin config file for Apache then the system sends the above notification message, so I believe the ideal value forapply_cmd=
should besystemctl reload httpd
.Moreover, I noticed another empty value in the file:
graceful_cmd=
which probably should be equal to
apachectl graceful
.Submitted by yngens on Wed, 09/30/2015 - 17:51 Comment #13
In the same manner I suggest to replace
service mariadb start
service mariadb stop
in
/etc/webmin/mysql/config
withsystemctl start mariadb
systemctl stop mariadb
For that matter all RHEL 6.x style
service name command
need to be replaced by RHEL 7.x stylesystemctl command name
.I've found the following incidents:
cat /etc/webmin/*/* | grep '_cmd=service'
stop_cmd=service named stop
start_cmd=service named start
stop_cmd=service dhcpd stop
restart_cmd=service dhcpd restart
start_cmd=service dhcpd start
start_cmd=service ipsec start
stop_cmd=service ipsec stop
restart_cmd=service ipsec restart
start_cmd=service tgtd start
stop_cmd=service tgtd stop
restart_cmd=service tgtd restart
cat: start_cmd=service slapd start
stop_cmd=service slapd stop
apply_cmd=service slapd restart
stop_cmd=service cups stop
start_cmd=service cups start
stop_cmd=service postgresql stop
start_cmd=service postgresql start
start_cmd=service proftpd start
stop_cmd=service proftpd stop
stop_cmd=service smb stop
start_cmd=service smb start
start_cmd=service sshd start
stop_cmd=service sshd stop
restart_cmd=service rsyslog reload
start_cmd=service rsyslog start
start_cmd=service syslog-ng start
stop_cmd=service syslog-ng stop
start_cmd=service xinetd start
Submitted by JamieCameron on Wed, 09/30/2015 - 19:16 Comment #14
Doesn't the
reload
command completely stop and re-start Apache though? Whereasgraceful
just tells it to re-read the config.Submitted by yngens on Sun, 10/04/2015 - 10:04 Comment #15
Doesn't the reload command completely stop and re-start Apache though? Whereas graceful just tells it to re-read the config.
I am not sure, Jamie, but that might be true for RHEL 6.x. As I said before on RHEL 7.x the system sends the following notice:
/etc/cron.daily/logrotate:
Redirecting to /bin/systemctl reload httpd.service
Redirecting to /bin/systemctl reload httpd.service
so it is redirecting graceful to reload anyway, then why we don't make it easier for the system and use the correct command without redirecting it?
Please also read http://www.cyberciti.biz/faq/apache-making-changes-config-file-without-r... which seems to imply both are the same.
The accepted answer on another thread http://stackoverflow.com/questions/671667/apache-httpd-reload compares
restart
andreload
:/my/path/to/httpd restart
Causes the current httpd process to exit, which means for a time the server appears to be down, as in not serving any requests./my/path/to/httpd reload
Does not cause the current server to exit, which means connections are never refused and thus the server never looks down (but is rather slow for a little while)Also, will you please replace all these commands:
cat /etc/webmin/<em>/</em> | grep '_cmd=service'
stop_cmd=service named stop
start_cmd=service named start
stop_cmd=service dhcpd stop
restart_cmd=service dhcpd restart
start_cmd=service dhcpd start
start_cmd=service ipsec start
stop_cmd=service ipsec stop
restart_cmd=service ipsec restart
start_cmd=service tgtd start
stop_cmd=service tgtd stop
restart_cmd=service tgtd restart
cat: start_cmd=service slapd start
stop_cmd=service slapd stop
apply_cmd=service slapd restart
stop_cmd=service cups stop
start_cmd=service cups start
stop_cmd=service postgresql stop
start_cmd=service postgresql start
start_cmd=service proftpd start
stop_cmd=service proftpd stop
stop_cmd=service smb stop
start_cmd=service smb start
start_cmd=service sshd start
stop_cmd=service sshd stop
restart_cmd=service rsyslog reload
start_cmd=service rsyslog start
start_cmd=service syslog-ng start
stop_cmd=service syslog-ng stop
start_cmd=service xinetd start
Submitted by JamieCameron on Sat, 10/03/2015 - 00:38 Comment #16
Ok, the next Webmin release will include these changes (for Apache).
I'm reluctant to use
systemctl
more widely, as theservice
command is compatible with more distributions.Submitted by yngens on Sun, 10/04/2015 - 10:21 Comment #17
I'm reluctant to use systemctl more widely, as the service command is compatible with more distributions.
I see your concern, however you have different repositories for different OS distributions, don't you? If so then you can safely replace all commands in RHEL 7.x-based distributions (https://en.wikipedia.org/wiki/List_of_Linux_distributions#RHEL-based) since RHEL 7.x switched to "systemctl command service-name" format and all the consecutive releases will do too.
Moreover, you can switch one level up and replace all "service" commands on Fedora-based distributions (https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet), because it was not RHEL, but Fedora which made a shift: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet
Please also read https://fedoraproject.org/wiki/Systemd and especially pay attention to this quote from https://docs.fedoraproject.org/en-US/Fedora/18/html/Installation_Guide/s...
Expect legacy commands to be deprecated!
systemctl fully replaces traditional utilites like service and chkconfig. While some services can still be administered with these legacy commands, all services can be administered with systemctl.
So "service ..." will be eventually deprecated on Fedora-based distros. Then why wait, especially when Virtualmin is sending unnecessary reports because of the old-style commands?
Ok, the next Webmin release will include these changes (for Apache). I would like to know when we can expect this?
Submitted by andreychek on Sun, 10/04/2015 - 16:06 Comment #19
While I don't have an exact day, the next Virtualmin release is expected very soon. Within the next few days.
Submitted by yngens on Mon, 10/05/2015 - 07:42 Comment #20
Hi Jamie,
I would still love to hear your stance on the following quote from:
https://fedoraproject.org/wiki/Systemd and especially pay attention to this quote from https://docs.fedoraproject.org/en-US/Fedora/18/html/Installation_Guide/s...
Expect legacy commands to be deprecated!
systemctl fully replaces traditional utilites like service and chkconfig. While some services can still be administered with these legacy commands, all services can be administered with systemctl.
Please try to understand while it is ok to leave "service ..." style commands on Debian based distros, all of them should be replaced by "systemctl ..." style on Fedora-based distros. Otherwise, Virtualmin/Webmin based systems will just keep sending unnecessary notification messages to root mail. Which is really annoying.
Submitted by yngens on Sun, 11/01/2015 - 12:41 Comment #21
Unfortunately, all CentOS 7.x based Virtualmin systems keep sending everyday notifications to root like:
/etc/cron.daily/logrotate:
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
And it is really annoying as we can't block the root messages to be able to receive other important notifications. So I am afraid all "service" like commands have to be replaced systemwide.
Submitted by andreychek on Sun, 11/01/2015 - 14:05 Comment #22
Yes, you will need to change the .conf files for your websites in /etc/logrotate.d to use your preferred Apache restart command.
While Jamie will be pushing out a release that changes the default command used for new installs, that shouldn't change any existing config files. Existing config files will need to be manually updated.
Submitted by yngens on Mon, 11/02/2015 - 08:41 Comment #23
Eric,
Please read the issue from the very beginning. Jamie doesn't want to replace all "service" like style commands as he thinks it is more universal. Which is true as it works on other distros like Debian, Ubuntu. However as I explained above Fedora-based systems like RHEL, CentOS, Scientific Linux, etc will eventually completely switch to "systemctl" style commands.
Manually editing is not helpful as (1) we have lot's of such servers and (2) the next update from Virtualmin repository could override our changes. And that is why I am asking Jamie and the team to really pay attention to above stated changes in Fedora-world. You really can not ignore them and eventually will have to replace all "service" like commands to "systemctl" like ones, however the problem is that until then all Fedora 7.x based Virtualmin server owners have to suffer from receiving unnecessary notifications. It is extremely problematic when you have lot's of Virtualmin servers.
Submitted by andreychek on Mon, 11/02/2015 - 09:03 Comment #24
Yes, I'm aware of what you're describing.
What I'm saying is that Virtualmin can't tell whether the commands being used within logrotate are what the administrator wants, or whether the administrator wants it replaced.
In fact, you mentioned this here:
the next update from Virtualmin repository could override our changes
That's exactly what Virtualmin would seek to avoid, it can never tell if a user wants the config being used.
Because of that, I do not believe that Virtualmin would attempt to change any existing logrotation configuration. I believe Jamie would only have it change the config for newly added domains.
We can of course verify this with Jamie before making any changes, but I think you're going to need to manually change any existing configuration.
There are ways to mass change that, you wouldn't necessarily need to edit each and every config file individually.
For example, disabling the logrotate feature, and then re-enabling it, would cause it to be re-written using whatever Apache restart command you currently have setup.
So you could simply run these two commands:
virtualmin disable-feature --all-domains --logrotate
virtualmin enable-feature --all-domains --logrotate
And that will re-write all the log rotation config files for each of your websites on that server, with whatever the Apache restart command is currently set to.
Submitted by yngens on Mon, 11/02/2015 - 09:50 Comment #25
Thanks Eric,
We will try to manually update logrotate on all previously existing servers. However, I still believe there is no much sense in keeping the following obsolete commands in Fedora-based systems, they all need to be replaced as otherwise Virtualmin systems will keep sending unnecessary notifications:
cat /etc/webmin/<em>/</em> | grep '_cmd=service'
stop_cmd=service named stop
start_cmd=service named start
stop_cmd=service dhcpd stop
restart_cmd=service dhcpd restart
start_cmd=service dhcpd start
start_cmd=service ipsec start
stop_cmd=service ipsec stop
restart_cmd=service ipsec restart
start_cmd=service tgtd start
stop_cmd=service tgtd stop
restart_cmd=service tgtd restart
cat: start_cmd=service slapd start
stop_cmd=service slapd stop
apply_cmd=service slapd restart
stop_cmd=service cups stop
start_cmd=service cups start
stop_cmd=service postgresql stop
start_cmd=service postgresql start
start_cmd=service proftpd start
stop_cmd=service proftpd stop
stop_cmd=service smb stop
start_cmd=service smb start
start_cmd=service sshd start
stop_cmd=service sshd stop
restart_cmd=service rsyslog reload
start_cmd=service rsyslog start
start_cmd=service syslog-ng start
stop_cmd=service syslog-ng stop
start_cmd=service xinetd start
Submitted by yngens on Wed, 12/16/2015 - 01:47 Comment #26
This is still an issue on Webmin 1.770 as all the "service" style commands there intact and all our systems keep sending us annoying messages... :(
Submitted by JamieCameron on Wed, 12/16/2015 - 19:34 Comment #27
Was this a new install, or an upgrade? The commands don't get modified on an upgrade.
Submitted by yngens on Thu, 12/17/2015 - 19:56 Comment #28
It was completely new install from CentOS 7.x template available through Cloudmin UI.
Submitted by JamieCameron on Sat, 12/19/2015 - 01:05 Comment #29
That's very unusual, as the default config for CentOS 7 defintely uses
systemctl
commands.Which exact VM template did you use?
Submitted by yngens on Sat, 12/19/2015 - 07:22 Comment #30
CentOS 7.0 64-bit KVM instance with base OS
Submitted by JamieCameron on Sat, 12/19/2015 - 15:22 Comment #31
Could be that Webmin is detecting your OS incorrectly. Can you post the
/etc/webmin/config
file from your system?Submitted by yngens on Sun, 12/20/2015 - 06:09 Comment #32
Sure:
cat /etc/webmin/config
passwd_cindex=2
passwd_uindex=0
real_os_type=CentOS Linux
real_os_version=7.2.1511
mobile_theme=virtual-server-mobile
cache_mods=virtual-server
webprefix=
logfiles=1
os_version=15.2
passwd_file=/etc/shadow
tempdelete_days=7
cache_size=52428800
by_view=0
log=1
os_type=redhat-linux
md5pass=1
theme=xenlayer-theme
ld_env=LD_LIBRARY_PATH
lang=en.UTF-8
find_pid_command=ps auwwwx | grep NAME | grep -v grep | awk '{ print $2 }'
path=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
passwd_mindex=4
passwd_pindex=1
referers_none=1
product=webmin
hostnamemode=0
help_width=
dateformat=dd/mon/yyyy
showhost=0
nofeedbackcc=0
hostnamedisplay=
feedback_to=custom@email.com
sysinfo=0
showlogin=0
help_height=
But I have already edited commands in /etc/webmin/apache/config.
Anyway, what is the status of the following files under /etc/webmin/ directory:
./postgresql/config
./syslog-ng/config
./syslog/config
./bind8/config
./xinetd/config
./lpadmin/config
./ipsec/config
./proftpd/config
./samba/config
./sshd/config
./dhcpd/config
./ldap-server/config
./iscsi-tgtd/config
which also have the following obsolete commands:
stop_cmd=service named stop
start_cmd=service named start
stop_cmd=service dhcpd stop
restart_cmd=service dhcpd restart
start_cmd=service dhcpd start
start_cmd=service ipsec start
stop_cmd=service ipsec stop
restart_cmd=service ipsec restart
start_cmd=service tgtd start
stop_cmd=service tgtd stop
restart_cmd=service tgtd restart
start_cmd=service slapd start
stop_cmd=service slapd stop
apply_cmd=service slapd restart
stop_cmd=service cups stop
start_cmd=service cups start
stop_cmd=service postgresql stop
start_cmd=service postgresql start
start_cmd=service proftpd start
stop_cmd=service proftpd stop
stop_cmd=service smb stop
start_cmd=service smb start
start_cmd=service sshd start
stop_cmd=service sshd stop
restart_cmd=service rsyslog reload
start_cmd=service rsyslog start
start_cmd=service syslog-ng start
stop_cmd=service syslog-ng stop
and the system is occasionally giving or sending notices because of them?
Please have them all changed for CentOS 7.x. You can leave them on Debian based systems, but RHEL will never return to "Service" style command and there is no point of torturing us, Virtulmin/Webmin system administrators - we can't turn of root mail, at the same time it is sending so many unnecessary messages because of these commands.
Submitted by JamieCameron on Sun, 12/20/2015 - 12:34 Comment #33
Those other config files will be updated in the next Webmin release.
However, I just did a fresh install of Webmin 1.770 onto a VM created in Cloudmin from the CentOS 7 64-bit KVM template, and
/etc/webmin/apache/config
looked correct :test_manual=0
show_list=0
mime_types=/etc/mime.types
auto_mods=1
stop_cmd=systemctl stop httpd.service
pid_file=/run/httpd/httpd.pid
test_apachectl=1
max_servers=100
httpd_dir=/etc/httpd
start_cmd=systemctl start httpd.service
show_order=0
test_always=0
apachectl_path=/usr/sbin/apachectl
show_names=0
test_config=1
apply_cmd=systemctl reload httpd.service
httpd_path=/usr/sbin/httpd
allow_virtualmin=0
Submitted by yngens on Sun, 12/20/2015 - 19:25 Comment #34
Those other config files will be updated in the next Webmin release.
Thanks Jamie!
However, I just did a fresh install of Webmin 1.770 onto a VM created in Cloudmin from the CentOS 7 64-bit KVM template, and /etc/webmin/apache/config looked correct
Strange. The only thing is coming to my mind then is that probably I downloaded that image long time ago, which most probably is true, because there were lot's of updates.
Could you make Cloudmin check if the image file is too old and either (1) to automatically download the newest one or (2) output a recommenddation to update the file?
Submitted by JamieCameron on Mon, 12/21/2015 - 18:09 Comment #35
The image file itself shouldn't actually matter here, as long as it was still CentOS 7.