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.
On Sunday, 10 July 2016 12:15:23 UTC-4, Isaac A wrote:
>
> 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"
>
>
>
> On Thursday, June 9, 2016 at 3:44:50 AM UTC-6, leeand00 wrote:
>>
>> 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
>>
>>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/404ee1e9-c6ce-4b77-ab68-f985fdb7a929%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.