Update: After downloading the (almost) most recent version 2.11-019 ARM from http://sourceforge.net/projects/traccar-synology/ (traccar2.11-019-arm.spk) , injecting a hacked/patched traccar2.11-019-arm.spk/package.tgz/bin/traccar and rebuilding the archives, I am able up upload and manually install it to Synology DSM and it installs successfully with no errors and no fuss, with the easy config of all the appropriate ports.
This is great, as I can see whether or not it's running from within the Synology DSM GUI/Web interface, and stop/start it, which I've verified works by checking ps from SSH. It also runs on boot as it should.
Sure, the hack does basically undermine the purpose of the getpid() function, but I'm not sure if there's any other way. Unless one can somehow update the version of ps
used.
The other big challenge was installing ipkg via SSH, as there was no version specifically appropriate for the DS115j's CPU, but another Haswell one worked. Also, installing textutils required ipkg install textutils -force-overwrite
as otherwise it found files already existed from the install of coreutils and thus would fail without the force flag. Not the fault of traccar though.
Thanks for sharing this. Just one thing I want to mention here. Traccar package for Synology is provided by 1sthandy. I believe this is the official website for it:
http://www.1sthandy.de/category/synology/synology-traccar/?lang=en
Thanks for that. Good information either way I figure :)
Hi
Hope this is a fair way to get some notes to the developer(s).
Been attempting to install Traccar on a Synology DS115j. I did find some stuff here but it was rather ambiguous -- https://www.traccar.org/synology/
Maybe it's just my particular model, as it runs a ARM processor, but when I SSH in, it seems to be running BuildBox rather than bash. After much poking around, and getting the necessary dependencies installed, I was able to get it working, but it's a bit hackish.
I found that, in daemon mode, it would fail, citing PID file going stale. However, it turned out the Java VM was still running and Traccar was working. However, if I did traccar status it would say not running, and the only way to kill it was to restart (haven't got it to run on init) or find+kill the PID manually.
If I ran it in Console mode, ./traccar console , it works fine.
Attempting to run the daemon again, or console mode after attempting the daemon, would result in errors, due to there being an existing process + Java VM (trying to listen on the same ports specifically).
Turns out there's an issue with the getpid() function in the bin/traccar script. The Linux distro and/or BusyBox shell used by my particular version of Synology DSM has a different version of the ps command, in particular, it doesn't support the -p -o flags. Infact, it only supports just one flag: -w. Much less powerful.
If I disabled / unset the PIDFILE_CHECK_PID variable (commenting it out) at the beginning of the file, and modified this subsequent check in the getpid() function from:
pidtest=
$PSEXE -p $pid -o pid | grep "$pid" | tail -n 1
to:
pidtest="$pid"
to effectively "bypass" this check, it would pass the PID check and everything would work fine.
I'm going to attempt to build a custom .spk installer with this hack for the Synology and see how I go. But perhaps a heads up for you guys, or anyone else that might stumble upon this.