Firmware: A-410 [01 Apr. 2014] | A-400 [12 Mar. 2014] | C-300 [13 Feb. 2014] | A-300 [24 Feb. 2014] | C-200 [11 July 2013] | A-200/A-210 [11 July 2013] | Popbox V8 [3 Dec 2013]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 1 Guest(s)
Thread Closed 
[myiHome] linux package and daemon script
08-31-2009, 12:16 AM (This post was last modified: 09-02-2009 12:53 PM by Shaika-Dzari.)
Post: #1
[myiHome] linux package and daemon script
Hello everyone! Smile

On linux, a good practice to install software is to use the package manager.
On Archlinux, this is pacman. (Ubuntu : apt-get, urpmi for mandrive, yum for fedora, etc.)

I made a PKGBUILD for myihome. For those who are not familiar, this is a script file you can use to create an Archlinux's package. When you have a package, you can install, upgrade and remove it easily.

The good news :
- The pkgbuild will install all you need to start myihome like any other daemon on linux (httpd, samba, etc...).
- Others scripts in my package are not "Archlinux specific"; people with ubuntu, slack, debian, etc, can use it to manage myihome like a daemon.

Howto for Archlinux

1- Download the pkgbuild : http://4nakama.net/download/last/myiHomeLinux.tar.gz
2- Uncompress the package in a folder
Code:
$ tar -xzvf myiHomeLinux.tar.gz
3- open a shell and go to the folder
Code:
$ cd path/to/myiHomeLinux
4- Build the package :
Code:
$ makepkg
5- Install the package as root (replace x86_64 by i686 if you have a 32 bits CPU)
Code:
# pacman -U myiHomeLinux-5.1.4-1-x86_64.pkg.tar.gz
6- Start myihome as root :
Code:
# /etc/rc.d/myihomelinux start

The first time you start myihome, the script will create a new user and a new group both name : myihomelinux. Sudo is use to start the daemon so myihome create video/music/photo folder in /home/myihomelinux/Librairy, etc.

If you want to start as another user, change the daemon script (line 37). As usual, if you want to use others folders than default one, create a preference.xml in /home/myihomelinux/Librairy/myihome/ and set videopath (Info : http://www.networkedmediatank.com/wiki/i...g_in_Linux).

Howto for another linux distribution

You can't use the pkgbuild with another distribution. So you will need to work a little.
Before anything, read this : http://www.networkedmediatank.com/wiki/i...g_in_Linux. You need to have a proper java environment before installing myihome.

Here we go:

1- Download my package http://4nakama.net/download/last/myiHomeLinux.tar.gz
2- Uncompress the package in a folder
Code:
$ tar -xzvf myiHomeLinux.tar.gz
3- Download myihome from network media tank website:
http://www.networkedmediatank.com/downlo..._note.html
4- Uncompress it in another folder
Code:
$ tar -xzvf myiHomeLinux-v5.1.4.tar.gz
5- As root, create a folder in /opt
Code:
# mkdir -p /opt/myiHomeLinux
6- Copy all files in this folder
Code:
# cp -R myiHomeLinux-v5.1.4/* /opt/myiHomeLinux/
7- Always as root, replace original web.xml with the one you can find in may package:
Code:
# rm /opt/myiHomeLinux/conf/web.xml
# cp path/to/mypackage/myiHomeLinux/web.xml /opt/myiHomeLinux/conf/
8- Copy log4j.properties from my package:
Code:
# cp path/to/mypackage/myiHomeLinux/log4j.properties /opt/myiHomeLinux/
9- Copy the file we use to start myihome as a daemon:
Code:
# cp path/to/mypackage/myiHomeLinux/myihomelinux /etc/rc.d/
10- Myihome need a folder to build .jsp. We will create it in /home/myihomelinux (you can use another subfolder of /home/myihomelinux if you want).
Code:
# rm -R /opt/myiHomeLinux/work
# ln -s /home/myihomelinux/ /opt/myiHomeLinux/work
11- Start myihome as root :
Code:
# /etc/rc.d/myihomelinux start

Like I said earlier, a new user/group is create. Look in /home/myihomelinux.

NOTES:
- Command prefix with a $ is use as a simple user
- Command prefix with a # is use as root
- You can share, modify, do what you want with these scripts.
- I am not responsible for any damage if you break your distrib with these scripts. Please ask for help before breaking stuff, I will try my best to help you.
- Others linux distributions can use a different folder for daemon scripts than /etc/rc.d/. Search dbus or crond in a shell to find it (locate crond).
- You can find myihome logfile in /home/myihomelinux/logfile.log

INFOS:
- Download myihome : http://www.networkedmediatank.com/downlo..._note.html
- WIKI : http://www.networkedmediatank.com/wiki/i...g_in_Linux
- ABS and makepkg : http://wiki.archlinux.org/index.php/ABS_..._Explained

Enjoy! Big Grin
Visit this user's website Find all posts by this user
[+] 1 user says Thank You to Shaika-Dzari for this post
09-02-2009, 12:48 PM
Post: #2
RE: [myiHome] linux package and daemon script
Hello everyone!

Just a small update to say to send a new version on my website.

## Changelog ##
- Myihome is stopping correctly when you use /etc/rc.d/.
- Clean daemon script.
- Clean PKGBUILD
- Add Symlink in PKGBUILD. Myihome need a folder to build .jsp and can't do it in /opt/myiHomeLinux.

I will update the tutoriel for those who don't use Archlinux and explain how to make the symlink.

@+
Visit this user's website Find all posts by this user
09-08-2009, 05:44 PM
Post: #3
RE: [myiHome] linux package and daemon script
Hum,

138 views with no comments...

Can I have some feedback, was it useful to someone? Big Grin

@+
Visit this user's website Find all posts by this user
09-10-2009, 12:06 AM
Post: #4
RE: [myiHome] linux package and daemon script
Hello!

The package has been update on my site with myiHomeLinux 5.2.0.

Download: http://4nakama.net/download/last/myiHomeLinux.tar.gz

@+ Smile
Visit this user's website Find all posts by this user
09-10-2009, 05:02 AM
Post: #5
RE: [myiHome] linux package and daemon script
Nice job... you're right, packages are much easier to handle on linux.
Find all posts by this user
10-20-2009, 09:14 AM
Post: #6
RE: [myiHome] linux package and daemon script
Hello Shaika-Dzari,

I was searching how to daemonize myiHome on my ArchLinux NAS and I found your tutoriel.
I'll try it as soon as I can.
I plan to buy a C-200 in the next months.
I'll give you a feedback at this time.
Do you plan to add it to AUR ?

@+
Find all posts by this user
10-20-2009, 08:32 PM
Post: #7
RE: [myiHome] linux package and daemon script
Hello,

I installed it without too much problems.
I just had to replace /opt/java/bin/java by /opt/java/jre/bin/java in the start script (I'm under Archlinux too).

@+
Find all posts by this user
10-23-2009, 10:59 PM
Post: #8
RE: [myiHome] linux package and daemon script
(10-20-2009 08:32 PM)nin2jardin Wrote:  Hello,

I installed it without too much problems.
I just had to replace /opt/java/bin/java by /opt/java/jre/bin/java in the start script (I'm under Archlinux too).

@+

Hello!

Yeah, you right. This is an error since I have the JDK and you have the JRE. I will change the dependency.
I don't plan to add it to AUR because the PKGBUILD is not very clean. myiHome is not linux friendly right now.

On my Archlinux 64 bits, I switched to llink. I have a PKGBUILD too for llink and I will upload it here and on AUR.

Don't hesitate if you need help.

On peut jaser en français aussi si tu préfère Big Grin

@+

--
Proud linux user and anime addicts Big Grin
[ myiHome on Linux ] [ Wireless Bridge ]
Visit this user's website Find all posts by this user
01-12-2010, 03:46 AM
Post: #9
RE: [myiHome] linux package and daemon script
I'm trying to get this to work on a ubuntu 9.10 OS but i'm not having any luck. I'm pretty sure it has to do with the folder for the daemon scripts, but i'm sort of a Linux newb. I did move the start up script to /etc/init.d/ instead of etc/rc.d/ and then ran the update-rc.d on that script. When i go to start up the daemon, i get the following:
Code:
$ sudo /etc/init.d/myihomelinux start
/etc/init.d/myihomelinux: line 7: /etc/rc.conf: No such file or directory
/etc/init.d/myihomelinux: line 8: /etc/rc.d/functions: No such file or directory
/etc/init.d/myihomelinux: line 30: stat_busy: command not found
/etc/init.d/myihomelinux: line 42: add_daemon: command not found
/etc/init.d/myihomelinux: line 43: stat_done: command not found

I realize those files aren't there for this distro. I found rc.conf in /etc/init/ but when i change the path i get other errors. I'm not sure where /etc/rc.d/functions is located. Any ideas?
Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
Lightning [Script] Automatic wifi connection drop detection and reconnect mgtroyas 0 4,220 06-28-2010 11:32 PM
Last Post: mgtroyas
  Guide: Sharing files with Samba (Linux) dacken 1 4,717 12-28-2009 01:43 PM
Last Post: dacken
Information HOWTO: Linux/MacOS X automated DVD/VOB/M2TS to MKV with subs/audio tracks/chapters grok 35 56,783 12-07-2009 09:30 PM
Last Post: yonux
  A script to re-mux all the files in a folder npc100 0 3,132 07-19-2009 08:23 PM
Last Post: npc100
  HOWTO: Play DVDs from a Linux computer over NFS without ripping MrKiasu 9 16,211 02-07-2009 03:47 PM
Last Post: PoPEye
  MKV transcoding script for Linux/*BSD/Mac users onitake 4 7,435 12-01-2008 01:35 PM
Last Post: onitake

Forum Jump: