From 18c43a686f3e871a93a0783b3d07d58d3085fbb6 Mon Sep 17 00:00:00 2001 From: Geunsik Lim Date: Mon, 24 Apr 2017 10:18:12 +0900 Subject: [PATCH] [tic-web] systemd: service file for systemd at boot time * How to enable a service file u16.04$> sudo cp ./systemd/tic-web.service /lib/systemd/systemd u16.04$> systemctl enable tic-web.service u16.04$> systemctl start tic-web.service u16.04$> systemctl status tic-web.service u16.04$> journalctl -u tic-web.service Change-Id: I6e31d59c42a486429fdcdc932d2c5b160b8add89 Signed-off-by: Geunsik Lim --- systemd/tic-web.service | 14 ++++++++++++++ systemd/tic-web.sh | 4 ++++ 2 files changed, 18 insertions(+) create mode 100644 systemd/tic-web.service create mode 100755 systemd/tic-web.sh diff --git a/systemd/tic-web.service b/systemd/tic-web.service new file mode 100644 index 0000000..7f44ee9 --- /dev/null +++ b/systemd/tic-web.service @@ -0,0 +1,14 @@ +[Unit] +Description=Tizen Image Creator (TIC) - Web +After=network.target + +[Service] +EnvironmentFile=/etc/profile +Type=simple +User=score +Group=score +ExecStart=/home/score/.nvm/versions/node/v6.9.1/bin/node /home/score/tic/app.js +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/systemd/tic-web.sh b/systemd/tic-web.sh new file mode 100755 index 0000000..c40d47a --- /dev/null +++ b/systemd/tic-web.sh @@ -0,0 +1,4 @@ +#!/bin/bash +# Default port is 8081 +# PORT=8081 ./node_modules/pm2/bin/pm2 start app.js --name tic1 +node /home/score/tic/app.js -- 2.7.4