Hey guys. Thanks for the awesome.
Bellow is a unit file I've created to run deno as a service in Linux. This way it restarts itself automatically in case of a crash. As you can see, it's pretty simple.
Are there specfic signals that can be sent to deno in order to stop, reload, start at runtime?
Take a look
/etc/systemd/system/deno.service
[Unit]
Description=Deno 1.1.1 service
Documentation=http://deno.land
After=network.target
[Service]
Type=simple
PIDFile=/run/deno.pid
# Typescript App Default Install directory
WorkingDirectory=/home
# Deno runtime Default Install directory
ExecStart=/home/user1/.deno/bin/deno run --allow-net --allow-read httpServer.ts
# On failer, wait 60 seconds before auto-restarting.
RestartSec=60
# Auto-restart on failure.
Restart=on-failure
[Install]
WantedBy=multi-user.target
Running Deno instance of the app.
Enable Deno - Works
sudo systemctl enable deno
Start Deno - Works
sudo systemctl start deno
Stop Deno - Works
sudo systemctl stop deno
Reload Deno - Does not work.
sudo systemctl reload deno
hi, why not use pm2 ?
@suchislife801 did you confuse systemctl reload for systemctl restart?
systemctl restart - Restarts the process.
systemctl reload - Sends a signal (can't remember which at the back of my hand) to your process which you can use to reload configuration process, the process should stay running.
hi, why not use pm2 ?
hi, why not use systemd?
This is best suited for #showcase on Discord: https://discord.gg/deno. The issue tracker is for bugs and feature requests, directly related to Deno.
This is best suited for #showcase on Discord: https://discord.gg/deno. The issue tracker is for bugs and feature requests, directly related to Deno.
Most helpful comment
@suchislife801 did you confuse
systemctl reloadforsystemctl restart?systemctl restart- Restarts the process.systemctl reload- Sends a signal (can't remember which at the back of my hand) to your process which you can use to reload configuration process, the process should stay running.hi, why not use systemd?