Simple start/stop for stand alone version

Scripts for Madsonic
tokka
Posts: 7
Joined: 18 Jul 2013, 11:21
Has thanked: 0
Been thanked: 2 times

Simple start/stop for stand alone version

Unread post by tokka »

I don't know if may be of some interest, but in case these are the scripts i use to start/stop MS from the desktop:

Assuming your ms standalone folder is in /var/madsonic

start:

right click on the desktop - create new empty document - open it with a text editor, than past
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=OFF
Name[C]=Madsonic
Icon=/path/to/preferred/icon (NOTE: in my case this don't works with ms, dunno why)
Exec=sudo /var/madsonic/madsonic.sh
Comment[C]=
save the file and rename it in "Madsonic start", or what you prefer;

stop:
right click on the desktop - new file - open with a txt editor, than past

Code: Select all

#!/bin/sh

sudo killall java
save and close, rename it in Madsonic_stop (or what you prefer) than from terminal give:
cd Desktop
sudo chmod +x Madsonic_stop

In this way you can start/stop ms with a click from your Desk.
Hope this will be of some help
These users thanked the author tokka for the post:
Madsonic
Rating: 7.69%
etyrnal
Posts: 64
Joined: 04 Nov 2013, 05:56
Has thanked: 31 times
Been thanked: 11 times

Re: Simple start/stop for stand alone version

Unread post by etyrnal »

sudo killall java
what if there are other java instances running that aren't related to madsonic??
User avatar
DoCC
Contributor
Contributor
Posts: 211
Joined: 25 Feb 2014, 14:41
Has thanked: 40 times
Been thanked: 65 times

Re: Simple start/stop for stand alone version

Unread post by DoCC »

ps aux |grep java
ps aux |grep madsonic

>>

Code: Select all

ps aux |grep madsonic
root     14548  1.0 33.2 4589240 1346324 ?     Sl   Dec22  46:12 java -Xms512m -Xmx1800m -Dmadsonic.home=/var/madsonic -Dmadsonic.host=0.0.0.0 -Dmadsonic.port=4040 -Dmadsonic.httpsPort=0 -Dmadsonic.contextPath=/ -Dmadsonic.defaultMusicFolder=/var/media/artists -Dmadsonic.defaultUploadFolder=/var/media/incoming -Dmadsonic.defaultPodcastFolder=/var/media/podcast -Dmadsonic.defaultPlaylistImportFolder=/var/media/playlists/import -Dmadsonic.defaultPlaylistExportFolder=/var/media/playlists/export -Dmadsonic.defaultPlaylistBackupFolder=/var/media/playlists/backup -Duser.timezone= -Dmadsonic.gzip= -Djava.awt.headless=true -verbose:gc -jar madsonic-booter.jar
jan      29938  0.0  0.0  10464   936 pts/0    R+   00:30   0:00 grep --color=auto madsonic
top
htop

lets you get the PID of the java process responsible for madsonic ...

#kill pid ( i.e. kill 1234 )
or
kill -9 pid ( forced )
etyrnal
Posts: 64
Joined: 04 Nov 2013, 05:56
Has thanked: 31 times
Been thanked: 11 times

Re: Simple start/stop for stand alone version

Unread post by etyrnal »

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/
Post Reply