Skip to content
Snippets Groups Projects
Commit d7780f28 authored by Bob Mottram's avatar Bob Mottram
Browse files

Handling nodejs within templates

parent 26d5dbfa
No related branches found
No related tags found
No related merge requests found
......@@ -827,7 +827,11 @@ fi
if [ $app_daemon ]; then
echo ''
echo " useradd -d \"TODO_PATH_TO_INSTALL\" -s /bin/false ${app_name}"
if [[ ! "$app_dir" ]]; then
echo " useradd -d \"TODO_PATH_TO_INSTALL\" -s /bin/false ${app_name}"
else
echo " useradd -d \"${app_dir}\" -s /bin/false ${app_name}"
fi
echo ''
echo " { echo '[Unit]';"
echo " echo 'Description=${app_name}';"
......@@ -843,9 +847,20 @@ if [ $app_daemon ]; then
else
echo " echo 'WorkingDirectory=${app_dir}';"
fi
echo " echo 'ExecStart=TODO';"
if [[ ! "$app_nodeapp" ]]; then
if [ ! $app_node ]; then
echo " echo 'ExecStart=TODO';"
else
echo " echo 'ExecStart=/usr/local/bin/npm start';"
echo " echo 'ExecStop=/usr/local/bin/npm stop';"
fi
else
echo " echo 'ExecStart=/usr/local/bin/node $app_nodeapp';"
echo " echo 'Environment=NODE_ENV=production';"
fi
echo " echo 'Environment=USER=${app_name}';"
echo " echo 'Restart=always';"
echo " echo 'Environment=\"USER=${app_name}\"';"
echo " echo 'StandardError=syslog';"
echo " echo '';"
echo " echo '[Install]';"
echo " echo 'WantedBy=multi-user.target'; } >> \"/etc/systemd/system/${app_name}.service\""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment