This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 720513 - Provide native systemd unit file for boa
Provide native systemd unit file for boa
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: boa (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Remi Collet
Fedora Extras Quality Assurance
:
Depends On:
Blocks: SysVtoSystemd 751869
  Show dependency treegraph
 
Reported: 2011-07-11 18:06 EDT by Jóhann B. Guðmundsson
Modified: 2015-01-06 14:04 EST (History)
6 users (show)

See Also:
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 02:31:02 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Native systemd service file for boa (192 bytes, text/plain)
2011-07-11 18:12 EDT, Jóhann B. Guðmundsson
no flags Details
Native systemd service file for boa (142 bytes, text/plain)
2011-11-16 13:13 EST, Jóhann B. Guðmundsson
no flags Details

  None (edit)
Description Jóhann B. Guðmundsson 2011-07-11 18:06:53 EDT
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 15:52:44 EDT
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 13:13:58 EST
Created attachment 534065 [details]
Native systemd service file for boa
Comment 4 Jóhann B. Guðmundsson 2011-11-16 13:20:54 EST
(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 Jon Ciesla 2012-05-11 11:02:10 EDT
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 11:10:18 EDT
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 Jon Ciesla 2012-05-11 11:18:16 EDT
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 12:33:26 EDT
I like :-)
Comment 9 Tom "spot" Callaway 2012-05-11 12:46:20 EDT
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 Jon Ciesla 2012-05-11 12:51:37 EDT
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 13:03:04 EDT
(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 Jon Ciesla 2012-05-11 13:16:05 EDT
Yeah.

I'll work something up and post it here for review.
Comment 13 Fedora End Of Life 2013-04-03 12:04:07 EDT
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 08:28:55 EDT
[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 08:30:05 EDT
Sorry, I've just realized that the same unit was attached to this bug.
Comment 16 Fabio Erculiani 2013-04-27 08:33:33 EDT
Sorry, I am still asleep. The point is that Type=forking is not needed at all.
Comment 17 Niranjan Mallapadi Raghavender 2013-09-16 11:05:34 EDT
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 11:36:40 EDT
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 11:37:10 EDT
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-26 20:34:11 EDT
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 02:31:02 EDT
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 02:56:24 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.