Bug 720513

Summary: Provide native systemd unit file for boa
Product: [Fedora] Fedora Reporter: Jóhann B. Guðmundsson <johannbg>
Component: boaAssignee: Remi Collet <fedora>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: fedora, gwync, lxnay, matthias, mniranja, tcallawa
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: boa-0.94.14-0.21.rc21.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-02 06:31:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 713562, 751869    
Attachments:
Description Flags
Native systemd service file for boa
none
Native systemd service file for boa none

Description Jóhann B. Guðmundsson 2011-07-11 22:06:53 UTC
Description of problem:

https://fedoraproject.org/wiki/Features/SysVtoSystemd

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 2 Tom "spot" Callaway 2011-09-27 19:52:44 UTC
Until there is a good way to handle the conditionals in the same fashion as the sysvinit script, I do not believe it makes sense to migrate this to a system unit service.

I've explained the issue to Lennart, and he's thinking about the best way to support it in systemd.

Comment 3 Jóhann B. Guðmundsson 2011-11-16 18:13:58 UTC
Created attachment 534065 [details]
Native systemd service file for boa

Comment 4 Jóhann B. Guðmundsson 2011-11-16 18:20:54 UTC
(In reply to comment #2)
> Until there is a good way to handle the conditionals in the same fashion as the
> sysvinit script, I do not believe it makes sense to migrate this to a system
> unit service.
> 
> I've explained the issue to Lennart, and he's thinking about the best way to
> support it in systemd.

Sorry not following what the problem is here.

The /etc/sysconfig/ file serves no purpose any more given that users and admins alike should just copy the unit file to /etc/systemd/system directory and alter the already existing parameters there or create a new empty one add an .include directive along with any addition they want to make to it.

Comment 5 Gwyn Ciesla 2012-05-11 15:02:10 UTC
I see no reason not to simple source the sysconfig.  Mattias, if you have no objections, I'll go ahead with this.

Comment 6 Matthias Saou 2012-05-11 15:10:18 UTC
I still haven't written any systemd files yet, so I don't have any idea what the proper solution here is.

Reminder of the problem : Boa doesn't have a configuration file, it expects all of its options on the command line. Spot seemed to imply that this couldn't be easily done for systemd, like it was for the sysv script by sourcing the sysconfig file.

Jon : If you have a clean solution to this, please go ahead!

Comment 7 Gwyn Ciesla 2012-05-11 15:18:16 UTC
It's actually very simple, though it may not once have been.  If your sysconfig is /etc/sysconfig/foo and contains

FOO=onceler
BAR=quatrain
BAZ=bicuit

then your unit file can be something like:

[Unit]
Description=A service for doing things
After=syslog.target

[Service]
Type=forking
EnvironmentFile=-/etc/sysconfig/foo
ExecStart=/usr/sbin/food $FOO $BAR $BAZ
ExecReload=/usr/sbin/food -k restart

And Bob's your uncle.  I can do it if you like.

Comment 8 Matthias Saou 2012-05-11 16:33:26 UTC
I like :-)

Comment 9 Tom "spot" Callaway 2012-05-11 16:46:20 UTC
No, actually, it isn't that simple.

This is how it was executing the daemon in start() in the old initscript:

daemon $exec ${SERVERROOT+" -c $SERVERROOT"}${CHROOT+" -r $CHROOT"}${DEBUG_LEVEL+" -l $DEBUG_LEVEL"} 2>/dev/null

You will note that it does not say:

daemon $exec ${SERVERROOT} ${CHROOT} ${DEBUG_LEVEL} 2>/dev/null

If those variables are set, then specific cmdline flags need to be passed to the daemon. The shell nature of the old initscript made this possible by invoking conditionalized expansions which added the various cmdline flags. Systemd has no such mechanism. boa does not technically _need_ any of these optional flags, but you cannot pass (for example) -c without also telling -c what the $SERVERROOT is, so you can't safely hardcode -c into the unit file.

The only way to make this work is to adjust the sysconfig file such that each of the options becomes a string including cmdline flags e.g.

CHROOT="-r /foo/bar"

The reason I didn't do it that way is because it would break old-style sysconfig files for boa, and since it is marked as a config(noreplace), I'm not sure there is a good way to force that change on everyone without nasty scripting.

Comment 10 Gwyn Ciesla 2012-05-11 16:51:37 UTC
Ooohh.  Yuck. :(

Maybe Just Do It and put it in the Release Notes?  I don't love it, but it's got to be done eventually.  Or do an update removing the noreplace, waiting a release, and then moving forward?  Or is that too evil? :)

Comment 11 Tom "spot" Callaway 2012-05-11 17:03:04 UTC
(In reply to comment #10)
> Ooohh.  Yuck. :(
> 
> Maybe Just Do It and put it in the Release Notes? 

I think this is probably the proper option to choose, although, I suspect it will result in _all_ of the existing boa users filing bugs against it failing to start. I was previously hopeful that systemd would add some sort of conditional mechanism to handle it natively, but I really don't have that hope anymore.

Comment 12 Gwyn Ciesla 2012-05-11 17:16:05 UTC
Yeah.

I'll work something up and post it here for review.

Comment 13 Fedora End Of Life 2013-04-03 16:04:07 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 14 Fabio Erculiani 2013-04-27 12:28:55 UTC
[Unit]
Description=Boa web server
After=network.target

[Service]
ExecStart=/usr/sbin/boa -d

[Install]
WantedBy=multi-user.target

--
Here's a working unit.

Comment 15 Fabio Erculiani 2013-04-27 12:30:05 UTC
Sorry, I've just realized that the same unit was attached to this bug.

Comment 16 Fabio Erculiani 2013-04-27 12:33:33 UTC
Sorry, I am still asleep. The point is that Type=forking is not needed at all.

Comment 17 Niranjan Mallapadi Raghavender 2013-09-16 15:05:34 UTC
Hi, 

Any chances of this getting fixed at least by Fedora-20, "Boa" seems to be needed by other packages like moodle and can't configure moodle unless "Boa" is fixed.

Any workaround ? 

Regards
Niranjan

Comment 18 Fedora Update System 2013-09-26 15:36:40 UTC
boa-0.94.14-0.21.rc21.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/boa-0.94.14-0.21.rc21.fc19

Comment 19 Fedora Update System 2013-09-26 15:37:10 UTC
boa-0.94.14-0.21.rc21.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/boa-0.94.14-0.21.rc21.fc20

Comment 20 Fedora Update System 2013-09-27 00:34:11 UTC
Package boa-0.94.14-0.21.rc21.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing boa-0.94.14-0.21.rc21.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-17684/boa-0.94.14-0.21.rc21.fc19
then log in and leave karma (feedback).

Comment 21 Fedora Update System 2013-10-02 06:31:02 UTC
boa-0.94.14-0.21.rc21.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 22 Fedora Update System 2013-10-02 06:56:24 UTC
boa-0.94.14-0.21.rc21.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.