Bind address always 127.0.0.1 when starting from Tiddlywiki from systemd

393 views
Skip to first unread message

leeand00

unread,
Jun 9, 2016, 5:44:50 AM6/9/16
to TiddlyWiki
Here is my Unit File:
[Unit]
Description=TW5 Bacula Wiki
After=nginx.service
Requires=nginx.service

[Service]
TimeoutStartSec=5000
ExecStart=/usr/local/bin/tiddlywiki /home/pi/tw5/linux/bacula --server 9094 $:/core/save/all text/plain text/html "" "" %H
User=Tw5
Group=Tw5

[Install]
WantedBy=multi-user.target


When I start it I get the following:

Jun 8 21:16:57 wiki tiddlywiki[1037]: Serving on 127.0.0.1:9094

I was hoping instead that it would bind to the ip of the DNS name (%H) ip but that didn't work either.

I've also tried 0.0.0.0 in the command without any luck.

Thank you,
Andrew J. Leer

Isaac A

unread,
Jul 10, 2016, 12:15:23 PM7/10/16
to TiddlyWiki
I was trying to deal with this all night myself. Googling didn't show any answer. I finally got it working, though I don't know why it works this way but not the other way. 

I had to use a environmentfile and variables for the command. Except for passing a blank user and password, I had to type that manually or it would host on 127 still. Maybe doing it without a conf file would work if you just put quotes around everything. That seems to be what made it start working finally for me in the conf file. 

Good luck. 

This is my tiddly.service
[Unit]
Description=tiddlywiki
After=syslog.target
[Service]
User=dokupe
Restart=always
StandardOutput=syslog
StandardError=syslog
EnvironmentFile=/etc/tiddlywiki.conf
ExecStart=/usr/bin/tiddlywiki $WIKI --server $PORT $OPTS "" "" $IP
[Install]
WantedBy=multi-user.target

and the /etc/tiddlywiki.conf:
WIKI="/home/user/newwiki"
PORT="8080"
OPTS="$:/core/save/all text/plain text/html"
USER=""
PWD=""
IP="0.0.0.0"

leeand00

unread,
Sep 17, 2016, 10:15:37 PM9/17/16
to TiddlyWiki
Figured this out via somebody else's post somewhere else...the deal is that you have to include an environment variables file, and fill in the values with that...

$ cat tw5resume.service.envvars
TW5LOC
=/usr/local/bin/tiddlywiki
WIKILOC
=/home/pi/tw5/jobhunt/resume
SERVERARG
=--server
WIKIPORT
=9098
ROOTTID
=$:/core/save/all
RENTYPE
=text/plain
SRVTYPE
=text/html
USRNAME
=****
PASSWD
=****
HOST
=wiki.domain.lan

and then...

[Unit]
Description=resume
After=nginx.service
Requires=nginx.service

[Service]
EnvironmentFile=/home/pi/tw5/jobhunt/resume/tw5resume.service.envvars
TimeoutStartSec=5000
ExecStartPre=-/bin/kill $(/bin/ss --all -p --tcp -4 | /bin/grep $WIKIPORT | /bin/awk '$1 == "LISTEN" {print $6}' | /bin/grep -o -e 'pid=[0-9]*' | /bin/grep -o -e '[0-9]*')
ExecStart=/usr/bin/nodejs $TW5LOC $WIKILOC $SERVERARG $WIKIPORT $ROOTTID $RENTYPE $SRVTYPE $USRNAME $PASSWD %H
ExecStop=/bin/kill $(/bin/ss --all -p --tcp -4 | /bin/grep $WIKIPORT | /bin/awk '$1 == "LISTEN" {print $6}' | /bin/grep -o -e 'pid=[0-9]*' | /bin/grep -o -e '[0-9]*')
User=pi
Group=pi

[Install]
WantedBy=multi-user.target
pi@wiki
:~/tw5/jobhunt/resume$ cat /etc/systemd/system/tw5resume.service
[Unit]
Description=resume
After=nginx.service
Requires=nginx.service

[Service]
EnvironmentFile=/home/pi/tw5/jobhunt/resume/tw5resume.service.envvars
TimeoutStartSec=5000
ExecStartPre=-/bin/kill $(/bin/ss --all -p --tcp -4 | /bin/grep 9094 | /bin/awk '$1 == "LISTEN" {print $6}' | /bin/grep -o -e 'pid=[0-9]*' | /bin/grep -o -e '[0-9]*')
ExecStart=/usr/bin/nodejs $TW5LOC $WIKILOC $SERVERARG $WIKIPORT $ROOTTID $RENTYPE $SRVTYPE $USRNAME $PASSWD %H
ExecStop=/bin/kill $(/bin/ss --all -p --tcp -4 | /bin/grep 9094 | /bin/awk '$1 == "LISTEN" {print $6}' | /bin/grep -o -e 'pid=[0-9]*' | /bin/grep -o -e '[0-9]*')
User=pi
Group=pi

[Install]
WantedBy=multi-user.target






Or something along those lines...now I'm having another issue..in which I can't get the thing to start up on boot on the pi, but once it's booted I can get in there and turn the thing on.

Ste Wilson

unread,
Sep 18, 2016, 6:46:11 AM9/18/16
to TiddlyWiki
Love to have a step by step breakdown/guide of your installation on the pi. I assume your doing a node.js thing. I've tried a few times but just bounced off it.
Reply all
Reply to author
Forward
0 new messages