_Package Name:_ transmission
_Package Version:_ 2.93-13
_NAS Model:_ DS212j
_NAS Architecture:_ ARMv7
_DSM version:_ 6.1.5-15245
It should be possible to run /var/packages/transmission/scripts/start-stop-status via SSH/script.
The following error occurs:
./service-setup: line 6: [: -lt: unary operator expected
_1._ Update to newest Transmission package (2.93-13)
_2._ Attempt to run the following command: /var/packages/transmission/scripts/start-stop-status status
The offending line appears to be in /var/packages/transmission/scripts/service-setup as follows:
if [ ${SYNOPKG_DSM_VERSION_MAJOR} -lt 6 ]; then EFF_USER="${SYNOUSER_PREFIX}${USER}"; else EFF_USER="${PRIV_PREFIX}${USER}"; fi
The issue is presumably that SYNOPKG_DSM_VERSION_MAJOR is undefined when run directly (rather than via synopkg) so there's nothing on the left side of the -lt operator.
While I realise that I can run all the same commands using synopkg, all other packages I've installed can be accessed via their start-stop-status script, and many guides are based upon that method, so it'd be nice if this continued to work.
The issue appears to be new since 2.93-12, perhaps there's another way to pull down these values, or the script could detect whether it's running via synopkg and, if not, ensure that it does so?
It's not going to work like that anymore indeed. All new packages will no longer work like that, since we now do it the way Synology intended.
Almost all functions now rely on these Synology environment variables.
The guides will just need to be updated.
(unless you disagree @ymartin59?)
It still seems like it should be possible to do it both ways though, surely?
The problem is that doing anything through synopkg seems to be really slow, whereas a direct command to start-stop-status will give the running status of most packages almost instantly, so it'd be nice to be able to bypass that added overhead of whatever synopkg does before it even bothers to run the script(s).
There is a way, but it's not very pretty.
Plus not very portable in case Synology decides to change locations of packages and support functions.
@Haravikk Sorry but it will probably never change back.
If you really want to short-circuit synopkg, I propose you as a work-around to set following environment variables before calling package start-stop-status:
SYNOPKG_PKGNAME="transmission"
SYNOPKG_PKGDEST=/var/packages/${SYNOPKG_PKGNAME}/target
SYNOPKG_DSM_VERSION_MAJOR=6
export SYNOPKG_PKGNAME SYNOPKG_PKGDEST SYNOPKG_DSM_VERSION_MAJOR
/var/packages/${SYNOPKG_PKGNAME}/scripts/start-stop-status status
If I guess right you have your own scripts to manage and monitor services, I think it is not so a big deal to export these additional variables to query package status
馃憤 Users that want this functionality can now use this work-around.
Most helpful comment
@Haravikk Sorry but it will probably never change back.
If you really want to short-circuit
synopkg, I propose you as a work-around to set following environment variables before calling packagestart-stop-status:If I guess right you have your own scripts to manage and monitor services, I think it is not so a big deal to export these additional variables to query package status