Skip to content

Instantly share code, notes, and snippets.

View maliarslan's full-sized avatar

Mehmet maliarslan

  • Heidelberg, Germany
  • 10:14 (UTC +02:00)
View GitHub Profile
@maliarslan
maliarslan / node-app-service-log.md
Last active February 21, 2018 14:24
Log service response in a custom file on Ubuntu 16.04

Let's say you have a Node app running as service but you also want to save response in a custom log. Add following lines to your systemd service unit (/lib/systemd/system/myapp.service) file under the [Service] tag

StandardOutput=syslog
StandardError=syslog
SyslogIdentifier='myapp'

Then reload systemd manager configuration

sudo systemctl daemon-reload
@maliarslan
maliarslan / node-app-as-service-on-ubuntu.md
Last active May 26, 2024 10:19
Run Node.js application as service on Ubuntu 16.04

Assuming that you have already installed Node.js on your system. If you haven't visit https://nodejs.org/en/download/package-manager/

First we need to create a service file into /lib/systemd/system to introduce our service.

So, with your favorite editor, open up a new file there with;

sudo nano /lib/systemd/system/mygreatestapp.service

Put the following contents in it;

[Unit]