Jikininki
jikininki setup notes
2017-09-05
Server Installation
Setup up HP t5740 thin clint "toast" as server "jikininki" with Debian 6.0 "Squeeze" using a 320MB external USB drive. As a source I used Debian 6.0 Installation CD image from a USB thumb drive. All went smoothly with a couple of exceptions:
- "archive.debian.org" as the source for packages
- GRUB installation is not useful for later boot of the target USB drive, because the drive's device reference changes from the installation to the first and subsequent boots without the install USB drive attached.
To overcome these problems:
- When choosing the mirror for package manager, do not select 'United States', instead choose the top-of-the-list item 'enter information manually'. For 'Debian archive mirror hostname use: 'archive.debian.org', then proceed normally.
- This was tough! The key is to boot the system manually (via Grub command line), then once the system is booted, modify /boot/grub/grub.cfg file.
- To boot manually:
- When the blue Grub Menu screen appears, press 'c' to get to the command line.
- Enter: 'set root=(hd0,msdos1)'
- Enter: 'linux /vmlinuz rootdelay=10 root=/dev/sdb1'
- Enter: 'initrd /initrd.img'
- Enter: 'boot'
- Once the system boots up, edit /boot/grub/grub.cfg
- Make all references to '(hd0,msdos1)'
- Insert 'rootdelay=10' into 'linux /boot/vmlinuz...' e.g. 'linux /boot/vmlinuz... --roodelay=10 root=...'
- Comment out the preceding 'search' line with '#'
- I'm not sure if it was necessary to run 'grub-setup /dev/sdb', but I did. This may not really be necessary.
- To boot manually:
At last I had a booting system, and fortunately this version of Debian uses UUIDs for determining which disk is which, so /etc/fstab is set up to mount the correct disks to each mount point.
Software Packages
This system is really only going to serve as my media repository, primarily for use by my KODI media players. Therefore, a minimal set of packages is all that is required. Here are the packages I installed:
- Samba
- smbclient
- Mysql
- wget
- rsync
- telnetd
- cifs-utils
- mhddfs
- hd-idle (from a self-made .DEB package [as directed by source doc])
Configuration
A few key configuration modification steps were necessary for this machine.
- move my self made shell script 'rdsamba.sh' to this server /root/rdsamba.sh
- this needs to be run once upon each new reboot of the server to eliminate disk access for the samba cache, instead directing cache to ramdisks.
- /etc/fstab
- (mounts for external USB drives
- mhddfs#/mnt/mybook/VIDEO,... /mnt/VIDEO fuse defaults,allow_other,mlimit=4G,user 0 0
- /etc/samba/smb.conf
- change
- workgroup=APPLERIDGE
- server hostname=(blank)
- security=share
- add shares for:
- fsroot
- jared
- mybook
- mybook2
- mybook3
- bupslim
- freeagent
- VIDEO
- change
- /etc/mysql/my.cnf
- (comment out) bind-address 127.0.0.1
- /etc/default/hd-idle
- START_HD_IDLE=true
- HD_IDLE_OPTS='-i 120'
KODI database
Add the KODI user to the mysql access table:
- USE mysql;
- INSERT INTO user VALUES('%','mpkodi',PASSWORK("(password)");
- INSERT INTO db VALUES('%','kodiVideo99','mpkodi','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
- INSERT INTO db VALUES('%','kodiMusic56','mpkodi','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
The simplest way to move the KODI database from the old server to this new server was to simply rsync it over. First I shutdown the source servers mysql daemon, then entered this command from the new server (logged in as root):
- rsync -av root@humbaba:/var/lib/mysql/kodiVideo99 /var/mysql/lib/
- rsync -av root@humbaba:/var/lib/mysql/kodiMusic56 /var/mysql/lib/
Then, modifications to the database tables to point to the new server:
- mysql -hlocalhost -umpkodi -p(password) -e "UPDATE (table) SET (field)=REPLACE((field),'humbaba','mpstore');" kodiVideo99
- arts
- url
- episode
- c18
- episode_view
- c18
- strPath
- movie
- c22
- movie_view
- c22
- strPath
- path
- strPATH
- arts
KODI media player
For each KODI box, I needed to update:
- /etc/hosts (make sure the new 'mpstore' server is listed
- /root/.kodi/userdata/advancedsettings.xml
- change 'humbaba' to 'mpstore' throughout