FAQ  •  Register  •  Login

[Solved] 1.6 Server Autostart on Mac

<<

mpi

Serviio lover

Posts: 66

Joined: Fri Nov 18, 2011 9:15 pm

Post Mon Feb 01, 2016 9:39 am

[Solved] 1.6 Server Autostart on Mac

Hi,

It seems the WIKI method (http://wiki.serviio.org/doku.php?id=mac ... _autostart) to disable Serviio autostart on Mac does not work anymore on Serviio 1.6 / El Capitan.
Please find my org.serviio.server.plist here:
http://pastebin.com/mwe1RZn0
Let me know if it is incorrect.

Maybe launchctl has evolved a bit recently...

Thanks for any hint.
Last edited by mpi on Wed Feb 03, 2016 8:37 pm, edited 2 times in total.
<<

mpi

Serviio lover

Posts: 66

Joined: Fri Nov 18, 2011 9:15 pm

Post Mon Feb 01, 2016 10:54 am

Re: 1.6 Server Autostart on Mac

Replying to myself...

According to this:
It seems now the proper way to enable/disable launchdeamons is trhough -w option in launchctl command.
Indeed Disabled status is stored in area that are not accessible.

Therefore to disable autolaunch, one should type in terminal:
  Code:
sudo launchctl unload -w /Library/LaunchDaemons/org.serviio.server.plist

And to re-enable:
  Code:
sudo launchctl load -w /Library/LaunchDaemons/org.serviio.server.plist


to launch without consideration of Disable status:
  Code:
sudo launchctl load -F /Library/LaunchDaemons/org.serviio.server.plist[


@zip: can you please double-check and eventually update instructions in WIKI to disable autostart?
Thanks!
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Feb 01, 2016 1:49 pm

Re: 1.6 Server Autostart on Mac

It says -w override the Disabled flag, so I assume it still looks at the plist flag first.

I don't have a Mac around, so cannot confirm, can someone else ?
<<

mpi

Serviio lover

Posts: 66

Joined: Fri Nov 18, 2011 9:15 pm

Post Mon Feb 01, 2016 4:35 pm

Re: 1.6 Server Autostart on Mac

For some obscure reason it seems a default override is set to Disabled false in my system.
Can be seen with:
  Code:
sudo cat /var/db/com.apple.xpc.launchd/disabled.plist

LaunchControl utility confirms this.
I did try to rebuild launchd database with tools like Onyx, but same result.

Can't find a way to remove that override except by using -w option as described above.
Curious if anyone else has the same issue (Serviio starting whatever state of Disabled key inside modified /Library/LaunchDaemons/org.serviio.server.plist as per WIKI)

Best
<<

mpi

Serviio lover

Posts: 66

Joined: Fri Nov 18, 2011 9:15 pm

Post Mon Feb 01, 2016 9:59 pm

Re: 1.6 Server Autostart on Mac

Same issue on another Mac running Serviio 1.5 under El Capitan.

However, finally found a workaround to remove override.
Restart the Mac under recovery mode (cmd-R), and then, under terminal edit (with vi or other)
  Code:
/Volumes/<YourVolumeName>/var/db/com.apple.xpc.launchd/disabled.plist

removing
<key>org.serviio.server</key>
<false/>
(mind what you do!)
With that, WIKI instructions work as expected to disable Serviio on startup.
Then to start the server manually, one should type:
  Code:
sudo launchctl load -F /Library/LaunchDaemons/org.serviio.server.plist
and
  Code:
sudo launchctl unload /Library/LaunchDaemons/org.serviio.server.plist
to stop it.

The tiny AppleScript app below allows to toggle the server in any circumstances, and launch console.
Attachments
Serviio_Toggle.app.zip
Serviio Toggle & Console for Mac v0.6
(36.39 KiB) Downloaded 329 times
<<

mpi

Serviio lover

Posts: 66

Joined: Fri Nov 18, 2011 9:15 pm

Post Tue Feb 02, 2016 8:58 am

Re: 1.6 Server Autostart on Mac

I think I found the root cause of the issue.
It probably lies in the post-install script of Serviio package:
  Code:
#!/bin/bash

SERVIIO_PLIST="/Library/LaunchDaemons/org.serviio.server.plist"

# Load and start the launch daemon
/bin/launchctl load -w $SERVIIO_PLIST

The -w option is the issue, as it sets the override!
Once set, Disable statement in plist as per WIKI is ignored.
It can not be removed at runtime: only through recovery (or single mode) as described above.

@zip, you may want to change to:
  Code:
/bin/launchctl load -F $SERVIIO_PLIST


Thanks.

EDIT: did set a Bitbucket ticket
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Tue Feb 02, 2016 4:24 pm

Re: 1.6 Server Autostart on Mac

great, thanks
<<

mpi

Serviio lover

Posts: 66

Joined: Fri Nov 18, 2011 9:15 pm

Post Wed Feb 03, 2016 1:38 pm

Re: 1.6 Server Autostart on Mac

You're welcome.

...one more thing...
After some tests, It turns out that one can remove the Disabled override which had been set with previous Installers under normal session (no need for Restore or Single mode), by typing:
  Code:
sudo defaults delete /var/db/com.apple.xpc.launchd/disabled.plist org.serviio.server

You may want to add that line to newer installers (along with changing the -w to -L option as mentioned previously).
This will then fix the override issue for all users who installed Serviio with previous installers.

Note:
You can test if override has been previously set on your system with:
  Code:
sudo defaults read /var/db/com.apple.xpc.launchd/disabled.plist org.serviio.server
It will return an error if Override was not set, or the 1-true value if it was set.

Return to Serviio Support & Help

Who is online

Users browsing this forum: No registered users and 54 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.