timothyej / Shortfin

Shortfin is a very fast and lightweight open-source web server that serves static content only.
GNU General Public License v2.0
170 stars 8 forks source link

systemd service file #2

Closed X4 closed 11 years ago

X4 commented 11 years ago

[Unit] Description=A fast & static web server for serving web apps. After=network.target remote-fs.target nss-lookup.target Hi, I just made a systemd service file. It can be improved to parametrically load different config files and more, but that's for later.

  1. Can you make the make install procedure simpler???
    • Just let it copy shortfin to /usr/local/sbin and the shortfin.conf to /usr/local/etc/shortfin/shortfin.conf or --prefix.
  2. Can you allow configuring shortfin based on directory structure instead of conf files??
  3. Make it even faster
[Service]
Nice=5
Type=simple
PIDFile=/run/shortfin.pid
ExecStartPre=/bin/mount --make-rprivate /
ExecStart=/usr/local/sbin/shortfin -c /usr/local/etc/shortfin/shortfin.conf -d
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/bin/kill -QUIT $MAINPID

[Install]
WantedBy=multi-user.target

Put this into /usr/lib64/systemd/system/shortfin.service and run: systemctl enable shortfin.service systemctl start shortfin.service

The service file works, but there is a bug (segfault) in shortfin. See: #3 I would be grateful for a gentoo ebuild.

ghost commented 11 years ago

I'd recommend throwing the systemd service file into contrib/ and sending off a pull request. I agree it would be nice to have (I've already moved the existing sysvinit script to contrib/). I would consider an ebuild outside the scope of things the upstream repo should have. 1.) I've already simplified make install 2.) Very interesting... 3.) ...

X4 commented 11 years ago

3) was just motivation to continue :) Keep up the good work! I'm sorry @timothyej I'm just very limited in time atm (have a very important deadline), could you just copy it to contrib, if you think it's useful? Thank you for that in advance :)

ghost commented 11 years ago

I committed your systemd service unit and sent pull request https://github.com/timothyej/Shortfin/pull/6 ; would you consider this issue closed?

X4 commented 11 years ago

Thanks @joshcartwright