Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 494704 - www-servers/thttpd - install a systemd unit file
Summary: www-servers/thttpd - install a systemd unit file
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Anthony Basile
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: install-systemd-unit
  Show dependency tree
 
Reported: 2013-12-19 00:25 UTC by Roc Vallès
Modified: 2013-12-20 15:19 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
systemd unit for thttpd (thttpd.service,273 bytes, text/plain)
2013-12-19 20:39 UTC, Roc Vallès
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roc Vallès 2013-12-19 00:25:43 UTC
thttpd doesn't provide a systemd unit file.

Reproducible: Always

Steps to Reproduce:
1. Install thttpd.
2. Try to start it with systemd.
Actual Results:  
Sadness at the lack of a thttpd.

Expected Results:  
Unit file is available, happiness and rejoice from the great gystemd+thttpd experience.
Comment 1 Anthony Basile gentoo-dev 2013-12-19 13:12:51 UTC
(In reply to Roc Vallès from comment #0)
> thttpd doesn't provide a systemd unit file.
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> 1. Install thttpd.
> 2. Try to start it with systemd.
> Actual Results:  
> Sadness at the lack of a thttpd.
> 
> Expected Results:  
> Unit file is available, happiness and rejoice from the great gystemd+thttpd
> experience.

Can you write me a systemd unit file and I'll add it.
Comment 2 Roc Vallès 2013-12-19 18:34:42 UTC
(In reply to Anthony Basile from comment #1)
> (In reply to Roc Vallès from comment #0)
> > thttpd doesn't provide a systemd unit file.
> > 
> > Reproducible: Always
> > 
> > Steps to Reproduce:
> > 1. Install thttpd.
> > 2. Try to start it with systemd.
> > Actual Results:  
> > Sadness at the lack of a thttpd.
> > 
> > Expected Results:  
> > Unit file is available, happiness and rejoice from the great gystemd+thttpd
> > experience.
> 
> Can you write me a systemd unit file and I'll add it.

Ok, I'll look into it tonight.
Comment 3 Roc Vallès 2013-12-19 20:39:34 UTC
Created attachment 365704 [details]
systemd unit for thttpd

Here's thttpd.service, written by me.
Comment 4 Anthony Basile gentoo-dev 2013-12-20 00:54:35 UTC
(In reply to Roc Vallès from comment #3)
> Created attachment 365704 [details]
> systemd unit for thttpd
> 
> Here's thttpd.service, written by me.

Okay, I've committed this with one change.  I removed the line

    WorkingDirectory=/var/www/thttpd

because that directory doesn't exists (or at least its not installed by portages) and this causes the daemon to fail to start.

Please test and re-open this bug if anything is broken.
Comment 5 Roc Vallès 2013-12-20 02:58:47 UTC
(In reply to Anthony Basile from comment #4)
> (In reply to Roc Vallès from comment #3)
> > Created attachment 365704 [details]
> > systemd unit for thttpd
> > 
> > Here's thttpd.service, written by me.
> 
> Okay, I've committed this with one change.  I removed the line
> 
>     WorkingDirectory=/var/www/thttpd
> 
> because that directory doesn't exists (or at least its not installed by
> portages) and this causes the daemon to fail to start.
> 
> Please test and re-open this bug if anything is broken.

Without WorkingDirectory... the server serves / by default. (!)

I don't think that's desirable behaviour, so you must set something reasonable on it.

From the conf.d default configuration file:

## the startup-dir of thttpd is the docroot, so we specify it here
## and the init-script does a "cd" prior to startup:
THTTPD_DOCROOT="/var/www/localhost"

I would at least set it to that for now.
Comment 6 Roc Vallès 2013-12-20 03:07:47 UTC
A preferred solution would be to change the default:

THTTPD_DOCROOT="/var/www/localhost"

to

THTTPD_DOCROOT="/var/www/thttpd"

And have the ebuild create the dir if it doesn't exist.

That makes more sense as a default, since thttpd does support vhosts, which would be implemented as directories from its DOCROOT.
Comment 7 Anthony Basile gentoo-dev 2013-12-20 15:12:42 UTC
(In reply to Roc Vallès from comment #6)
> A preferred solution would be to change the default:
> 
> THTTPD_DOCROOT="/var/www/localhost"
> 
> to
> 
> THTTPD_DOCROOT="/var/www/thttpd"
> 
> And have the ebuild create the dir if it doesn't exist.
> 
> That makes more sense as a default, since thttpd does support vhosts, which
> would be implemented as directories from its DOCROOT.

No that's not a good idea because of the way our vhosting works.  I'll add 

   WorkingDirectory=/var/www/localhost

to the unit file.
Comment 8 Anthony Basile gentoo-dev 2013-12-20 15:19:46 UTC
Committed.  Feel free to reopen if this doesn't work for you.  Its working at my end.