OS X version unsatisfactory as server

Got an idea? Missing something? Post your feature request here.

OS X version unsatisfactory as server

Unread postby etyrnal » 24 Dec 2014, 09:24

i have to say...

The OS X implementation is VERY unsatisfactory as a SERVER. The idea that it seems to require a GUI login to function, is silly. The OS X installer SHOULD, and MUST, install Madsonic as a system-wide service at boot time. Requiring it to be run by a user logging in is not only un-elegant, but creates problems too. And example: on a multiple user system, if you are playing music in remote control, by using an android phone to make musical selections that will play back on the server hardware, and another user logs in, the audio from Madsonic will cut out because the focus of the GUI has switched away from the user Madsonic was running under, whereas, if Madsonic were running as a boot time (pre-login / headless) service, this would not happen.

I have taken some people's advice and used a very non-elegant 'solution' of creating a user called 'services', setting the system to auto-login to that user at system boot time, and auto-launch Madsonic... but this also creates a very unreliable service in the background. It's honestly just dumb.

PLEASE adjust the installer to install madsonic as a boot-time service that does NOT require a login. PLEASE. The control panel can be moved to a system preferences panel, or to an app.

Or is there some way to just enable the built in web-sharing and have Madsonic run from inside the webserver??
etyrnal
 
Posts: 64
Joined: 04 Nov 2013, 05:56
Has thanked: 36 times
Been thanked: 11 times

Re: OS X version unsatisfactory as server

Unread postby DoCC » 24 Dec 2014, 09:57

sure, use the standalone version, you can trigger it starting stopping via scripts . but i think you have to do some research HOW TO : ) i just know linux ^^
or you setup an apache tomcat and apply the tomcat app of madsonic ...

should work aswell since apache servers are fired up at boot time
User avatar
DoCC
Contributor
Contributor
 
Posts: 210
Joined: 25 Feb 2014, 14:41
Location: UpperBavaria : ))
Has thanked: 41 times
Been thanked: 71 times

Re: OS X version unsatisfactory as server

Unread postby etyrnal » 24 Dec 2014, 11:13

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/madsonic/booter/Main : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)


os x 10.7.5 + java 8 update 25
etyrnal
 
Posts: 64
Joined: 04 Nov 2013, 05:56
Has thanked: 36 times
Been thanked: 11 times

Re: OS X version unsatisfactory as server

Unread postby DoCC » 24 Dec 2014, 11:34

this is a typical java versrion error

madsonic runs on java 7. therefor you might change the default jre back to 7

have a try
User avatar
DoCC
Contributor
Contributor
 
Posts: 210
Joined: 25 Feb 2014, 14:41
Location: UpperBavaria : ))
Has thanked: 41 times
Been thanked: 71 times

Re: OS X version unsatisfactory as server

Unread postby etyrnal » 24 Dec 2014, 12:22

INFO: Madsonic 5.2 Requirements/Support

Oracle JAVA Version 1.7 or 1.8
Tomcat Server 7.x or 8.x
Jetty 6.x/7.x/8.x
etyrnal
 
Posts: 64
Joined: 04 Nov 2013, 05:56
Has thanked: 36 times
Been thanked: 11 times

Re: OS X version unsatisfactory as server

Unread postby etyrnal » 24 Dec 2014, 13:26

$ which java
/usr/bin/java

$ /usr/bin/java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

$ /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version
java version "1.7.0_71"

Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

$
etyrnal
 
Posts: 64
Joined: 04 Nov 2013, 05:56
Has thanked: 36 times
Been thanked: 11 times

Re: OS X version unsatisfactory as server

Unread postby etyrnal » 24 Dec 2014, 15:47

ok, installing java sdk 7 set up paths/env variables...

gonna try this... plist goes in /Library/LaunchDaemons/

com.[noneyo.business].madsonic.plist


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>GroupName</key>
<string>wheel</string>
<key>Disabled</key>
<false/>
<key>Label</key>
<string>com.[noneyo.business].madsonic</string>
<key>ProgramArguments</key>
<array>
<string>/private/var/madsonic/madsonic.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>Nice</key>
<integer>1</integer>
<key>KeepAlive</key>
<true/>
</dict>
</plist>


...fingers crossed, rebooting... i hope 'wheel' and 'keep alive' don't become nightmares
etyrnal
 
Posts: 64
Joined: 04 Nov 2013, 05:56
Has thanked: 36 times
Been thanked: 11 times

Re: OS X version unsatisfactory as server

Unread postby etyrnal » 24 Dec 2014, 21:44

why the heck is the STANDALONE version looking for madsonic.war in /Applications/Madsonic.app/Contents/Resources/Java/ when the script file points all the directories to /var/madsonic/ locations?!??

this is making less sense by the minute...


Dec 24, 2014 2:32:23 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@7fe27dce: display name [org.springframework.context.support.ClassPathXmlApplicationContext@7fe27dce]; startup date [Wed Dec 24 14:32:23 CST 2014]; root of context hierarchy
Dec 24, 2014 2:32:24 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [applicationContext-deployer.xml]
Dec 24, 2014 2:32:24 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@7fe27dce]: org.springframework.beans.factory.support.DefaultListableBeanFactory@410ba083
Dec 24, 2014 2:32:24 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@410ba083: defining beans [service,org.springframework.remoting.rmi.RmiServiceExporter#0]; root of factory hierarchy
Error: WAR file not found: /Applications/Madsonic.app/Contents/Resources/Java/madsonic.war
Failed to resolve build number from WAR: /Applications/Madsonic.app/Contents/Resources/Java/madsonic.war
etyrnal
 
Posts: 64
Joined: 04 Nov 2013, 05:56
Has thanked: 36 times
Been thanked: 11 times

Re: OS X version unsatisfactory as server

Unread postby etyrnal » 24 Dec 2014, 21:47

Closest i've come to getting launchd to work:


.PLIST: com.redacted.madsonic (in /Library/LaunchDaemons/



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>UserName</key>
<string>root</string>
<key>GroupName</key>
<string>wheel</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>Nice</key>
<integer>1</integer>
<key>Label</key>
<string>com.redacted.madsonic</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/java</string>
<string>-Xms192m</string>
<string>-Xmx384m</string>
<string>-Dmadsonic.home=/var/madsonic</string>
<string>-Dmadsonic.host=0.0.0.0</string>
<string>-Dmadsonic.port=4040</string>
<string>-Dmadsonic.httpsPort=0</string>
<string>-Dmadsonic.contextPath=/ </string>
<string>-Dmadsonic.defaultMusicFolder=/var/media/artists</string>
<string>-Dmadsonic.defaultUploadFolder=/var/media/incoming</string>
<string>-Dmadsonic.defaultPodcastFolder=/var/media/podcast</string>
<string>-Dmadsonic.defaultPlaylistImportFolder=/var/media/playlists/import </string>
<string>-Dmadsonic.defaultPlaylistExportFolder=/var/media/playlists/export </string>
<string>-Dmadsonic.defaultPlaylistBackupFolder=/var/media/playlists/backup</string>
<string>-Duser.timezone=</string>
<string>-Dmadsonic.gzip=</string>
<string>-Djava.awt.headless=true</string>
<string>-verbose:gc</string>
<string>-jar</string>
<string>madsonic-booter.jar</string>
</array>
</dict>
</plist>



in the END it ALWAYS claims it can't find madsonic-booter.jar ... even if i specify the full pathname, and even if make a <string>/Applications/Madsonic.app/Contents/Resources/Java</string> -- again , why the heck is a standalone version looking there and NOT abiding by the declared directories??
etyrnal
 
Posts: 64
Joined: 04 Nov 2013, 05:56
Has thanked: 36 times
Been thanked: 11 times

Re: OS X version unsatisfactory as server

Unread postby DoCC » 24 Dec 2014, 23:02

hi, sry 4 late reply ... the stanalone version is not that standalone . at least is comes with 3 files : )

you need the 3 highlighted.
standalone_files.PNG


launchd points at the .sh file - here you can fine tune some settings.
the .sh file pipes these settings to the booter.jar
and the booter jar fires up the war file.

nothing special - in most cases : P
User avatar
DoCC
Contributor
Contributor
 
Posts: 210
Joined: 25 Feb 2014, 14:41
Location: UpperBavaria : ))
Has thanked: 41 times
Been thanked: 71 times

Re: OS X version unsatisfactory as server

Unread postby etyrnal » 26 Dec 2014, 03:03

launchd thinks the .sh file exits… i tried to use 'keep alive', but then realized the script just calls java with like 20 arguments/parameters…

so, i manually launched the madsonic.sh, then opened htop and copied the full command line that was used to start java (madsonic)…

trouble is, when i start it using launchd with the same arguments, something seems to be unable to find war or jar.

DoCC wrote:i just know linux ^^


then you'd do ok… OS X cli is bash. (bsd unix)
etyrnal
 
Posts: 64
Joined: 04 Nov 2013, 05:56
Has thanked: 36 times
Been thanked: 11 times

Re: OS X version unsatisfactory as server

Unread postby etyrnal » 26 Dec 2014, 04:20

ok, so, when i run the Madsonic.app, and do a "ps aux | grep java" in the terminal, i get:

$ ps aux | grep java
services 1755 0.0 4.2 3541792 704880 ?? S 9:00PM 35:27.47 /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java -Xms192m -Xmx384m -Dmadsonic.war=/Applications/Madsonic.app/Contents/Resources/Java/madsonic.war -Dmadsonic.home=/Library/Application Support/Madsonic -Dmadsonic.host=0.0.0.0 -Dmadsonic.port=4040 -Dmadsonic.httpsPort=0 -Dmadsonic.contextPath=/ -Dmadsonic.defaultMusicFolder=/Users/Shared/Music/iTunes/iTunes Media -Dmadsonic.defaultUploadFolder=/Users/Shared/Music/iTunes/iTunes Media -Dmadsonic.defaultPodcastFolder=/Users/Shared/Podcasts -Dmadsonic.defaultPlaylistImportFolder=/Users/Shared/Playlists -Dmadsonic.defaultPlaylistExportFolder=/Users/Shared/Playlists/export -Dmadsonic.defaultPlaylistBackupFolder=/Users/Shared/Playlists/backup -jar /Applications/Madsonic.app/Contents/Resources/Java/madsonic-booter.jar -mac


/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java \
-Xms192m \
-Xmx384m \
-Dmadsonic.war=/Applications/Madsonic.app/Contents/Resources/Java/madsonic.war \
-Dmadsonic.home=/Library/Application Support/Madsonic \
-Dmadsonic.host=0.0.0.0 \
-Dmadsonic.port=4040 \
-Dmadsonic.httpsPort=0 \
-Dmadsonic.contextPath=/ \
-Dmadsonic.defaultMusicFolder=/Users/Shared/Music/iTunes/iTunes Media \
-Dmadsonic.defaultUploadFolder=/Users/Shared/Music/iTunes/iTunes Media \
-Dmadsonic.defaultPodcastFolder=/Users/Shared/Podcasts \
-Dmadsonic.defaultPlaylistImportFolder=/Users/Shared/Playlists \
-Dmadsonic.defaultPlaylistExportFolder=/Users/Shared/Playlists/export \
-Dmadsonic.defaultPlaylistBackupFolder=/Users/Shared/Playlists/backup \
-jar \
/Applications/Madsonic.app/Contents/Resources/Java/madsonic-booter.jar \
-mac\

-Dmadsonic.war=/var/madsonic/madsonic.war <=== this variable isn't set in the shell version… gonna try this
etyrnal
 
Posts: 64
Joined: 04 Nov 2013, 05:56
Has thanked: 36 times
Been thanked: 11 times

Re: OS X version unsatisfactory as server

Unread postby etyrnal » 26 Dec 2014, 08:15

stuck here now…

HTTP ERROR: 404

Problem accessing /. Reason:

Not Found
Powered by Jetty://
etyrnal
 
Posts: 64
Joined: 04 Nov 2013, 05:56
Has thanked: 36 times
Been thanked: 11 times

Re: OS X version unsatisfactory as server

Unread postby DoCC » 26 Dec 2014, 13:56

hi : )

we have here /var/madsonic/ ....

is this dir existent at your machine ?
here you can find the logs

Code: Select all
jan@madsonic:~$ ls -l /var/madsonic/
total 1308
drwxrwxrwx  2 root root   4096 Dec  4 03:31 config
drwxrwxrwx  3 root jan    4096 Dec 26 03:07 db
drwxrwxrwx  2 root root   4096 Dec  4 03:32 db_5200
drwxrwxrwx  5 root root   4096 Dec 19 22:07 jetty
drwxrwxrwx  8 root root   4096 Dec  4 03:36 lucene2
-rwxrwxrwx  1 root root 755538 Dec 26 13:52 madsonic.log
-rwxrwxrwx  1 root jan    4371 Dec 26 03:07 madsonic.properties
-rwxrwxrwx  1 root root    194 Dec  4 03:32 madsonic.properties_5200
-rw-r--r--  1 root root 529555 Dec 26 13:54 madsonic_sh.log
drwxr-xr-x 23 root root   4096 Dec 24 05:32 thumbs
drwxrwxrwx  2 root root   4096 Dec  5 09:28 transcode

(( pls ignore the chmod settings . i recently had to deal with winscp. : P ))

the madsonic_sh log contains the system relevant log. madsonic.log is just madsonics own log _ no error hunting here


in addition ...

the madsonic operating files are located here

Code: Select all
jan@madsonic:~$ ls -l /usr/share/madsonic/
total 109032
-rwxrwxrwx 1 jan  jan   8205745 Dec 14 14:46 madsonic-booter.jar
-rwxrwxrwx 1 jan  jan   8126873 Nov 11 11:11 madsonic-booter.jar_
-rwxrwxrwx 1 jan  jan      7768 Oct 29 23:17 madsonic.sh
-rwxrwxrwx 1 jan  jan      7768 Oct 29 23:17 madsonic.sh_
-rwxrwxrwx 1 jan  jan  46820209 Dec 14 14:52 madsonic.war
-rwxrwxrwx 1 jan  jan  48336512 Nov 11 11:11 madsonic.war_


files with _ are older version files, in case an update doesn't work ...
User avatar
DoCC
Contributor
Contributor
 
Posts: 210
Joined: 25 Feb 2014, 14:41
Location: UpperBavaria : ))
Has thanked: 41 times
Been thanked: 71 times

Re: OS X version unsatisfactory as server

Unread postby etyrnal » 27 Dec 2014, 14:16

DoCC wrote:$ ls -l /usr/share/madsonic/



but this goes completely against all the install instructions i found...
etyrnal
 
Posts: 64
Joined: 04 Nov 2013, 05:56
Has thanked: 36 times
Been thanked: 11 times

Re: OS X version unsatisfactory as server

Unread postby etyrnal » 27 Dec 2014, 14:18

etyrnal wrote:stuck here now…

HTTP ERROR: 404

Problem accessing /. Reason:

Not Found
Powered by Jetty://



so, to me, this says:

a.) jetty is running, and accepting connections
b.) when the index is requested, it, or something it refers to is not in the right place…

no?
etyrnal
 
Posts: 64
Joined: 04 Nov 2013, 05:56
Has thanked: 36 times
Been thanked: 11 times

Re: OS X version unsatisfactory as server

Unread postby DoCC » 28 Dec 2014, 09:59

etyrnal wrote:but this goes completely against all the install instructions i found...


mmh may be, usr share is the path selected via debian installer ...
now maintained manually with standalone packages ...

til now i don't really know what the exact setup of your thingy is : P

for a comparison :
i got the executable sh war jar files in /usr/share/madsonic
the folder containing logs, database and jetty stuff resides in /var/madsonic

at /var/madsonic
there are two files : madsonic.log and madsonic_sh.log
in _sh log there are every logs listed fired by jetty, hsqldb and java
so maybe there is something for you ?

keep in mind, you are dealing with apple, there may be different things going on.
i am just trying to push you in a direction that should work , but that is not for sure since i never got the chance getting "pro" stuff : ))
User avatar
DoCC
Contributor
Contributor
 
Posts: 210
Joined: 25 Feb 2014, 14:41
Location: UpperBavaria : ))
Has thanked: 41 times
Been thanked: 71 times

Re: OS X version unsatisfactory as server

Unread postby etyrnal » 19 Jan 2015, 02:40

DoCC wrote: til now i don't really know what the exact setup of your thingy is : P


exactly how the instructions for the standalone version say to. i created the folders indicated manually.
etyrnal
 
Posts: 64
Joined: 04 Nov 2013, 05:56
Has thanked: 36 times
Been thanked: 11 times

Re: OS X version unsatisfactory as server

Unread postby etyrnal » 22 Jan 2018, 18:43

For those trying to launch headless (macOS/OS X) at system boot, with no users logged in, this may help you figure things out:

Good INFO:
http://www.launchd.info/

and this amazing app:
http://www.soma-zone.com/LaunchControl/
etyrnal
 
Posts: 64
Joined: 04 Nov 2013, 05:56
Has thanked: 36 times
Been thanked: 11 times


Return to Feature Requests 5.x

Who is online

Users browsing this forum: No registered users and 0 guests