Bug 697137

Summary: apache2: systemd needs async ask-password integration instead of X-Interactive
Product: [openSUSE] openSUSE 12.1 Reporter: Jiri Slaby <jslaby>
Component: BasesystemAssignee: Roman Drahtmueller <draht>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: fcrozat, kairo
Version: Factory   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 696902    
Attachments: strace -fo strace systemctl start apache2.service

Description Jiri Slaby 2011-05-31 09:58:43 UTC
# systemctl start apache2.service
Job failed. See system logs and 'systemctl status' for details.

From /var/log/messages:
systemd[1]: apache2.service operation timed out. Terminating.
systemd[1]: Unit apache2.service entered failed state.

I would say this is a regression in some of the recent updates.
Comment 1 Jiri Slaby 2011-05-31 09:59:03 UTC
# rpm -q systemd apache2
systemd-28-110.1.x86_64
apache2-2.2.17-7.1.x86_64
Comment 2 Kay Sievers 2011-05-31 11:25:53 UTC
Any idea what times out?

You need passwords to entered to start it up?

What does:
  systemctl status apache2.service
say?
Comment 3 Jiri Slaby 2011-05-31 11:30:48 UTC
(In reply to comment #2)
> Any idea what times out?

Nope.

> You need passwords to entered to start it up?

No, I have not configured anything like that.

> What does:
>   systemctl status apache2.service
> say?

apache2.service - LSB: Apache 2.2 HTTP Server
          Loaded: loaded (/etc/init.d/apache2)
          Active: failed since Tue, 31 May 2011 10:05:31 +0000; 1h 23min ago
         Process: 2115 ExecStart=/etc/init.d/apache2 start (code=killed, signal=TERM)
          CGroup: name=systemd:/system/apache2.service
Comment 4 Jiri Slaby 2011-05-31 11:31:38 UTC
Created attachment 432249 [details]
strace -fo strace systemctl start apache2.service

Strace of the process. There are some ask-pass strings. Dunno if it means anything.
Comment 5 Kay Sievers 2011-05-31 12:48:14 UTC
(In reply to comment #4) 
> Strace of the process. There are some ask-pass strings. Dunno if it means
> anything.

Systemctl always starts the password agent if started from a console,
regardless if the service will need it.

The problem is X-Interactive in the init script. Apache will need to ask
systemd asynchronously for passwords, instead of waiting on the console.

The X-Interactive needs to be removed.

Here is the Fedora bug:
  https://bugzilla.redhat.com/show_bug.cgi?id=707917#c3
Comment 6 Jiri Slaby 2011-05-31 12:56:43 UTC
(In reply to comment #5)
> The problem is X-Interactive in the init script. Apache will need to ask
> systemd asynchronously for passwords, instead of waiting on the console.
> 
> The X-Interactive needs to be removed.

If I remove it, the problem still persists. Is there any workaround? (I have the very same problem with openvpn. However this one I reported earlier.)

> Here is the Fedora bug:
>   https://bugzilla.redhat.com/show_bug.cgi?id=707917#c3
Comment 7 Kay Sievers 2011-05-31 13:07:06 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > The problem is X-Interactive in the init script. Apache will need to ask
> > systemd asynchronously for passwords, instead of waiting on the console.
> > 
> > The X-Interactive needs to be removed.
> 
> If I remove it, the problem still persists. Is there any workaround?

You did a:
  systemctl --system daemon-reload
after editing the init script?

> (I have
> the very same problem with openvpn. However this one I reported earlier.)

Yes, it's the same problem, but not such a simple shell script fix.
Openvpn does not have the nice exec directive apache has, it needs
a plugin for openvpn that does the async password.
Comment 8 Jiri Slaby 2011-05-31 13:27:11 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > (In reply to comment #5)
> > > The problem is X-Interactive in the init script. Apache will need to ask
> > > systemd asynchronously for passwords, instead of waiting on the console.
> > > 
> > > The X-Interactive needs to be removed.
> > 
> > If I remove it, the problem still persists. Is there any workaround?
> 
> You did a:
>   systemctl --system daemon-reload
> after editing the init script?

Oh my, that's the trick.

> > (I have
> > the very same problem with openvpn. However this one I reported earlier.)
> 
> Yes, it's the same problem, but not such a simple shell script fix.

My openvpn is compiled to accept passwords from files (it waits for no input). So the fix should be identical...

Thanks.
Comment 9 Kay Sievers 2011-05-31 13:31:59 UTC
(In reply to comment #8)
> My openvpn is compiled to accept passwords from files (it waits for no input).
> So the fix should be identical...

Right, it should only be needed if passwords needs to be queried at
service startup.
Comment 10 Frederic Crozat 2011-07-08 11:49:50 UTC
I've done a test package at home:fcrozat:systemd / apache2 which plugs into systemd ask password service, when apache2 is started from systemd.

Roman, does it seem ok for you, as apache maintainer ?
Comment 11 Frederic Crozat 2011-08-24 16:54:09 UTC
I've sr changes (sr 79684) for review.
Comment 12 Frederic Crozat 2011-09-12 13:38:48 UTC
sr accepted in Apache project, closing.
Comment 13 Bernhard Wiedemann 2011-09-16 08:40:53 UTC
This is an autogenerated message for OBS integration:
This bug (697137) was mentioned in
https://build.opensuse.org/request/show/82181