Bug 10934

Summary: drakwizard - Proftpd wizard fails because of --no-block option in systemctl
Product: Mageia Reporter: Derek Jennings <derekjenn>
Component: RPM PackagesAssignee: Mageia Bug Squad <bugsquad>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Normal CC: bozonius, sysadmin-bugs, thierry.vignaud, wilcal.int
Version: 3   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard: PATCH
Source RPM: drakwizard-3.9-1.mga3 drakxtools-15.54.1-2.mga3 CVE:
Status comment:
Bug Depends on:    
Bug Blocks: 10830    
Attachments: New subroutine for 'systemctl reload-or-restart'
Call reload_or_restart

Description Derek Jennings 2013-08-06 18:47:35 CEST
When using drakwizard to set up a ProFTP server, at the end of the wizard there is a failure message saying there is a misconfiguration and to run the wizard again.

The message is caused because  at the end of the wizard the proftpd service is restarted, and then immediately checked to confirm the service is started.

When using systemctl the subroutine _run_action in services.pm  uses the systemctl option --no-block  which causes systemctl to enqueue the action and return before it is complete.

The subsequent check on the service status is performed before the action is complete, so the wizard reports the service is not working.


Possible solutions that come to mind are :-
1/ Add a subroutine to services.pm  to perform systemctl reload-or-restart  without a --no-block option.

2/ Add subroutine to Wizcommon.pm to perform restart_or_start without --no-block

Reproducible: 

Steps to Reproduce:
Comment 1 Derek Jennings 2013-08-06 20:19:07 CEST
Created attachment 4242 [details]
New subroutine for 'systemctl reload-or-restart'

This works for me when called from Proftpd.pm when proftpd is either already running, or is stopped.
Comment 2 Derek Jennings 2013-08-06 20:21:08 CEST
Created attachment 4243 [details]
Call reload_or_restart

Patch for Proftpd.pm.  Similar patches would be required for the other wizards too.
Comment 3 Derek Jennings 2013-08-06 20:28:29 CEST
Adding tv to cc for comments.

Thierry. This is Bug 6009 come back again since Proftp became native systemctl.

Is the approach in my patch OK or can you think of a better way?

Whiteboard: (none) => PATCH
CC: (none) => thierry.vignaud

Comment 4 William Kenney 2013-08-23 15:23:21 CEST
(In reply to Derek Jennings from comment #3)

> Thierry. This is Bug 6009 come back again since Proftp became native
> systemctl.
> 
> Is the approach in my patch OK or can you think of a better way?

I seem to remember someone mentioning that this feature/function of
drakwizard for FTP ( proftpd ) and Apache are no longer being supported.
Apache was no longer prefork and became much more difficult to config
in drakwizard.

CC: (none) => wilcal.int

Derek Jennings 2013-08-23 22:08:56 CEST

Blocks: (none) => 10830

Comment 5 Derek Jennings 2013-08-24 08:41:26 CEST
In the end I decided to put the fix in Wizcommon.pm to avoid complicating dependencies.

The FTP wizard now works OK. It already worked apart from the bogus failure message.

The Apache wizard also works fine, but the Squid wizard had issues. It built a configuration for an obsolete version of squid.

I have updated the squid wizards default config file, and fixed the syntax errors in the config it generates, and now it also appears to work OK.

An updated drakwizard-3.10 will be available shortly.
Comment 6 bozonius 2013-08-30 22:16:08 CEST
Validating now on 32 bit.

CC: (none) => bozonius

Comment 7 Derek Jennings 2013-08-31 18:32:16 CEST
>Validating now on 32 bit.

Not ready for validating yet


Could a sysadmin please remove drakwizard-3.9-1.mga2.src.rpm and drakwizard-3.10-1.mga3.src.rpm  from mga2 and 3 core/updates_testing please?

I am putting the fix in the 3.7 and 3.9 branches for mga 2/3  and cannot push them with those there.
Thanks

CC: (none) => sysadmin-bugs

Comment 8 Derek Jennings 2013-09-10 20:46:55 CEST
fixed in
drakwizard-3.9.2-1.mga3
drakwizard-3.7.7-1.mga2
drakwizard-3.11-1.mga4

Status: NEW => RESOLVED
Resolution: (none) => FIXED