Skip to content

Commit

Permalink
add www-data to systemd-journal to view emonhub systemd log in Emoncm…
Browse files Browse the repository at this point in the history
…s emonhub config module
  • Loading branch information
glynhudson authored Feb 21, 2019
1 parent b2b84cb commit d35e4ca
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions emonhubupdate
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ homedir="/home/$username"
service="emonhub"
servicepath="$homedir/emonhub/service/emonhub.service"

# add www-data to systemd-journal to view emonhub systemd log in Emoncms emonhub config module
sudo usermod -a -G systemd-journal www-data

# Remove old init.d emonhub service
if [ -d /etc/systemd ] && [ -f $servicepath ]; then
if [ -f /etc/init.d/$service ]; then
echo "removing initd $service service"
Expand All @@ -28,6 +32,7 @@ if [ -d /etc/systemd ] && [ -f $servicepath ]; then
fi
fi

# remove old incorrectly installed systemd service
if [ -f /lib/systemd/system/$service.service ]; then
if ! [ -L /lib/systemd/system/$service.service ]; then
echo "Removing hard copy of $service.service in /lib/systemd/system (should be symlink)"
Expand All @@ -38,6 +43,7 @@ if [ -d /etc/systemd ] && [ -f $servicepath ]; then
fi
fi

# Install new emonhub systemd service
if [ ! -f /lib/systemd/system/$service.service ]; then
echo "Installing $service.service in /lib/systemd/system (creating symlink)"
sudo ln -s $servicepath /lib/systemd/system
Expand Down

0 comments on commit d35e4ca

Please sign in to comment.