Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Add new site without downtime #32

Open
almereyda opened this issue Jan 13, 2018 · 8 comments
Open

Add new site without downtime #32

almereyda opened this issue Jan 13, 2018 · 8 comments

Comments

@almereyda
Copy link

Since IPs and therefore ports are precious, one could want to build a static site hosting setup usable by multiple people. Does dathttpd allow to test and reload (SIGHUP) its configuration, in case sites want to be added or removed during runtime?

@pfrazee
Copy link
Member

pfrazee commented Jan 13, 2018

That should be feasible, it'd just need a PR to be added.

@matamalaortiz
Copy link

Not sure if this is the same question.
I've been adding new sites to .dathttpd.yml file and then running sudo systemctl stop dathttpd and sudo systemctl start dathttpd. This work fine, but I wonder if is there a better way to add sites without having to stop dathttpd?

@pfrazee
Copy link
Member

pfrazee commented Mar 18, 2018

@matamalaortiz yeah that's the same question. We just need to listen to a signal (maybe SIGHUP) and reload configuration off it.

@millette
Copy link

Or watch .dathttpd.yml and reload automatically as it changes.

@pfrazee
Copy link
Member

pfrazee commented Mar 19, 2018

@millette that's a neat idea but it might surprise some folks

@matamalaortiz
Copy link

SIGHUP signal worked fine but then the PID changes every time and I haven't found a way to keep track of that changes ( I don't have much experience with servers). Watching .dathttpd.yml turned to be better for me, but I have to use restart (or reload-or-restart) instead of reloading. Because reload returns Failed to reload dathttpd.service: Job type reload is not applicable for unit dathttpd.service. Thanks!

@callil
Copy link

callil commented Apr 4, 2018

@matamalaortiz can you share a bit more how you set up the watcher?

@matamalaortiz
Copy link

yeah @callil. Don't know if this is a proper way to do this but it's working for me. I created a node script to watch changes in the .dathttpd.yml file. (I used chokidar to watch and micromatch to read .dotfiles), then if there's any change in the file it triggers the reload. Run the script with pm2.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants