FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 07-18-2011, 08:34 PM
"R. G. Newbury"
 
Default F15: Questions re systemd

New install of F15 on Thinkpad X61. Httpd refuses to start using:
systemctl enable httpd.service; systemctl start httpd.service

User:group apache:apache exists and 'owns' /var/www

No httpd.service file was installed through yum. I created one containing:
**************************************
# httpd.service for systemd
# installed to /lib/systemd/system

[Unit]
Description=httpd daemon
After=mysqld.service

[Service]
EnvironmentFile=-/etc/sysconfig/httpd
ExecStart=/usr/sbin/httpd $OPTIONS -k start
ExecReload=/usr/sbin/httpd $OPTIONS -k restart
PIDFile=/run/httpd.pid
Type=forking
User=apache
Group=apache

[Install]
WantedBy=multi-user.target
****************************************

I only get 'Job failed. See system logs and 'systemctl status' for
details'. [FAILED]

Status details are no help. I added OPTIONS=" -e 3 -E
/var/log/httpd/error_log -w" to /etc/sysconfig/httpd, which systemctl
status says it is executing, but I get NO error_log entries.

Moreover, I get NO systems logs of any sort from systemctl/systemd.

FIRST QUESTION: Where are the system logs? I do NOT have a
/var/log/messages file.... Do I need to set a logging option somewhere?


SECOND QUESTION: If I use '/usr/sbin/httpd -k start', it works and I get
httpd threads in the ps list.
Service httpd status, at that point, says that the start FAILED.
Service httpd stop does not actually stop anything, nor does systemctl
httpd.service stop. (Does not know the pid?)

But another service httpd start, reports that httpd is already running....

Does anyone know how to get this working? My google-foo is lacking. I
can find nothing about where systemd logs data.
And I can find nothing about whether to remove the original (F14)
service files.


R. Geoffrey Newbury
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 07-20-2011, 12:05 AM
"T.C. Hollingsworth"
 
Default F15: Questions re systemd

On Mon, Jul 18, 2011 at 1:34 PM, R. G. Newbury <newbury@mandamus.org> wrote:
> New install of F15 on Thinkpad X61. Httpd refuses to start using:
> systemctl enable httpd.service; systemctl start httpd.service

Hmm, this works fine on my installation of F15. 'systemctl enable'
redirects to 'chkconfig' because httpd uses systemd's SYSV
compatibility, but both commands do what you expect.

>
> User:group apache:apache exists and 'owns' /var/www
>
> No httpd.service file was installed through yum. I created one containing:

httpd still uses a SYSV initscript. systemd is completely compatible
with them for the moment.

> **************************************
> # httpd.service for systemd
> # installed to /lib/systemd/system

Please do not install or edit unit files in /lib/systemd. Changes in
that directory can be overriden by package updates. Instead use
/etc/systemd/system, either by creating new unit files in that
directory or copying existing ones in /lib/systemd to /etc and editing
them. Unit files in /etc/systemd always override identically named
ones in /lib/systemd.

> [Unit]
> Description=httpd daemon
> After=mysqld.service

You probably want "network.target" in After too. (Although presumably
mysqld has that in its After too.) If you use NetworkManager and bind
httpd to particular IP addresses also add
"NetworkManager-wait-online.service" to After as well, otherwise it
might come up before it has a socket to bind to.

>
> [Service]
> EnvironmentFile=-/etc/sysconfig/httpd
> ExecStart=/usr/sbin/httpd $OPTIONS -k start
> ExecReload=/usr/sbin/httpd $OPTIONS -k restart
> PIDFile=/run/httpd.pid
> Type=forking

This might be your problem:

> User=apache
> Group=apache

httpd probably needs to be launched as root and allowed to drop
privileges on its own. (Don't quote me on this though; I don't know
much about the internal workings of httpd.)

One other thing that might affect it: if you bind httpd to particular
IP addresses, it might require the network to be active

> [Install]
> WantedBy=multi-user.target
> ****************************************
>
> I only get 'Job failed. See system logs and 'systemctl status' for
> details'. *[FAILED]
>
> Status details are no help. I added OPTIONS=" -e 3 -E
> /var/log/httpd/error_log -w" to /etc/sysconfig/httpd, which systemctl
> status says it is executing, but I get NO error_log entries.
>
> Moreover, I get NO systems logs of any sort from systemctl/systemd.
>
> FIRST QUESTION: Where are the system logs? *I do NOT have a
> /var/log/messages file.... Do I need to set a logging option somewhere?

systemd normally logs to syslog. You really should figure out why
syslog isn't working first.

That being said, you can force systemd to log elsewhere with the
"systemd.log_target=" kernel argument. Set it to "kmsg" to log to the
kernel message log or "console" to print errors on the console. You
can also set "systemd.log_level=debug" to get lots more output out of
systemd. More on these and a lot more at
http://fedoraproject.org/wiki/How_to_debug_Systemd_problems

> SECOND QUESTION: If I use '/usr/sbin/httpd -k start', it works and I get
> httpd threads in the ps list.
> Service httpd status, at that point, says that the start FAILED.
> Service httpd stop does not actually stop anything, nor does systemctl
> httpd.service stop. *(Does not know the pid?)

Exactly. Systemd has no idea httpd was started, nor does it need to.
It really shouldn't muck about with what the user didn't intend it to
control.

> But another service httpd start, reports that httpd is already running....

That error probably comes from httpd itself, not systemd.

> Does anyone know how to get this working? My google-foo is lacking. I
> can find nothing about where systemd logs data.
> And I can find nothing about whether to remove the original (F14)
> service files.

You don't have to. systemd unit files will always override
identically named legacy SYSV init scripts.

> * * * * * * *R. Geoffrey Newbury

-T.C.
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 07-20-2011, 06:49 PM
"R. G. Newbury"
 
Default F15: Questions re systemd

> R. G. Newbury <newbury@mandamus.org> wrote:
>> > New install of F15 on Thinkpad X61. Httpd refuses to start using:
>> > systemctl enable httpd.service; systemctl start httpd.service
> Hmm, this works fine on my installation of F15. 'systemctl enable'
> redirects to 'chkconfig' because httpd uses systemd's SYSV
> compatibility, but both commands do what you expect.
>
>> >
>> > User:group apache:apache exists and 'owns' /var/www
>> >
>> > No httpd.service file was installed through yum. I created one containing:
> httpd still uses a SYSV initscript. systemd is completely compatible
> with them for the moment.
>
>> > **************************************
>> > # httpd.service for systemd
>> > # installed to /lib/systemd/system
> Please do not install or edit unit files in /lib/systemd. Changes in
> that directory can be overriden by package updates. Instead use
> /etc/systemd/system, either by creating new unit files in that
> directory or copying existing ones in /lib/systemd to /etc and editing
> them. Unit files in /etc/systemd always override identically named
> ones in /lib/systemd.

Well *that* explains why there was no httpd.service file!. But it does
not quite explain why 'status' reported a 'fail'. I will rsync the
desktop F14 /etc/sysconfig/httpd and /etc/rc.d/init.d/httpd files and
see what happens then, when I run 'service httpd restart'


>> > [Unit]
>> > Description=httpd daemon
>> > After=mysqld.service
> You probably want "network.target" in After too. (Although presumably
> mysqld has that in its After too.) If you use NetworkManager and bind
> httpd to particular IP addresses also add
> "NetworkManager-wait-online.service" to After as well, otherwise it
> might come up before it has a socket to bind to.

Since I do not need it, I'll delete this file. I'll wait for someone who
*knows* what is going on the write one!


>> >
>> > [Service]
>> > EnvironmentFile=-/etc/sysconfig/httpd
>> > ExecStart=/usr/sbin/httpd $OPTIONS -k start
>> > ExecReload=/usr/sbin/httpd $OPTIONS -k restart
>> > PIDFile=/run/httpd.pid
>> > Type=forking
> This might be your problem:
>
>> > User=apache
>> > Group=apache
> httpd probably needs to be launched as root and allowed to drop
> privileges on its own. (Don't quote me on this though; I don't know
> much about the internal workings of httpd.)

You could well be right. Httpd wants to own the files in /var/www/html
etc. but since it is launched on boot, root would be the correct user to
do that.


> One other thing that might affect it: if you bind httpd to particular
> IP addresses, it might require the network to be active
>
>> > [Install]
>> > WantedBy=multi-user.target
>> > ****************************************
>> >
>> > I only get 'Job failed. See system logs and 'systemctl status' for
>> > details'. ?[FAILED]
>> >
>> > Status details are no help. I added OPTIONS=" -e 3 -E
>> > /var/log/httpd/error_log -w" to /etc/sysconfig/httpd, which systemctl
>> > status says it is executing, but I get NO error_log entries.
>> >
>> > Moreover, I get NO systems logs of any sort from systemctl/systemd.
>> >
>> > FIRST QUESTION: Where are the system logs? ?I do NOT have a
>> > /var/log/messages file.... Do I need to set a logging option somewhere?
> systemd normally logs to syslog. You really should figure out why
> syslog isn't working first.

SOLVED that bit. Somehow I chconfig'd OFF, the rsyslog daemon while
turning off all the rpc stuff (it forwarded to systemctl)....Does sorta
help!

> That being said, you can force systemd to log elsewhere with the
> "systemd.log_target=" kernel argument. Set it to "kmsg" to log to the
> kernel message log or "console" to print errors on the console. You
> can also set "systemd.log_level=debug" to get lots more output out of
> systemd. More on these and a lot more at
> http://fedoraproject.org/wiki/How_to_debug_Systemd_problems
>
>> > SECOND QUESTION: If I use '/usr/sbin/httpd -k start', it works and I get
>> > httpd threads in the ps list.
>> > Service httpd status, at that point, says that the start FAILED.
>> > Service httpd stop does not actually stop anything, nor does systemctl
>> > httpd.service stop. ?(Does not know the pid?)
> Exactly. Systemd has no idea httpd was started, nor does it need to.
> It really shouldn't muck about with what the user didn't intend it to
> control.

Well yup! But I thought that it WAS controlling....What we have here is
a failure to communicate, as someone once said!

-
R. Geoffrey Newbury

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 

Thread Tools




All times are GMT. The time now is 05:12 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org