OpenRC executes init.d scripts through /bin/sh thus they should be POSIX compliant. Initscript provided with hamachi uses bashisms which cause it even to be unusable with dash shell. This causes users having dash linked to /bin/sh to have problems starting Hamachi using initscripts. Although the daemon starts correctly, it does not log in automatically. /etc/init.d/hamachi start outputs following error: hamachi |* Starting hamachi... hamachi |[: 223: 0: unexpected operator [ ok ]i | Moreover, sometimes script does use '&>' and sometimes '2>&1 >'.
Created attachment 199173 [details, diff] Proposed fixes to the init.d script I've made following changes: 1) retab! 2) quoted all user-provided variables, especially paths, 3) changed '&>' to '2>&1 >', 4) removed '&' after hamachi start, hamachi goes to background itself, 5) because of that, removed 'sleep 1' too, 6) changed result test to numeric operator ('-eq') instead of bashish string '==', 7) removed '-R' from chown … ipc_sock — it is not a directory, and below chmod doesn't use '-R' anyway, 8) changed init() to return hamachi-init's result instead of chmod one, 9) provided correct service name to 'service_started' call, 10) made status() return non-zero if service isn't running.
CCing base-system to know their feedback in the openrc init-scripts
Looks good, but you could change $myservice to $SVCNAME
Created attachment 199631 [details, diff] Patch with Roy's suggestion applied
committed in tree as -r3