java - Copy Linux liveUSB causes errors with init.d scripts -
the overall problem
when install simple java application wrote run on boot in background through /etc/init.d/, works on liveusb explicitly install on. when make copy of stick, never boot successfully. when booting liveusb copy java application hang when liveusb boot process reaches script. script, supposed do, every 5 minutes , continue running forever until power down machine.
- my script blocking else
- nothing loads beyond script
- you cannot cancel script
- there no gui
- the text can see command line output script
setup & test - goes :)
i have linux liveusb 3 partitions. simple standard xubuntu image loaded.
- sda1 > 2gb stoage
- sda2 > 2gb system
- sda3 > remaining gb casper
i have created simple java application runs in background on start up. far, followed these steps:
- compiled java application classes
- placed class files in /home/user/folder/
- copied startup.sh script /etc/init.d/
- while inside /etc/init.d/
- typed "update-rc.d startup.sh start 20 2 5 . stop 20 0 1 6 ."
- this updated run levels successfully
- now can restart / reboot / shutdown whatever operation , runs perfectly!
the copy - here's gets tricky!
when creating copy of stick, follow these steps:
- mount sda2
- copy folder /home/user/desktop/tmp-system/
- mount sda3
- copy folder /home/user/desktop/tmp-casper/
- go /home/user/desktop/tmp-system/
- type "tar -cvf system.tar ."
- go /home/user/desktop/tmp-casper/
- type "tar -cvf casper.tar ."
- umount
- sda2
- sda3
- plug in empty usb (sdb example)
- set partitions (same stick copying from)
- untar partitions
- tar -xvf system.tar ... sdb2
- tar -xvf casper.tar ... sdb3
testing - here's goes wrong!
- plug in newly created liveusb computer
- boot usb
- everything starts boot fine
- java application wrote gets triggered
- boot process hangs forever
- no cmd prompt available
- no gui available
- it if thread running (and is! output can viewed every 5 minutes - way should be)
solution attempts & gotchas
1
i can mount copied liveusb edit startup.sh not start java application , still not boot (just suspected?).
2
if use "dd if=sda of=sdb" copy of liveusb work fine. not acceptable solution. if copy 16gb stick dd 64gb stick, turn 64gb stick 16gb.
3
tested many variations of startup.sh , java application itself. of produce same error.
4
the method using copy works every other form of application, file or else.
5
i try , avoid using additional libraries or programs run java application.
what might better use method create liveusb linux stick, add java program settings , directories. here - bootable pendrive live cd
i point number 1 mention. copy liveusb without java program not work. have spent quite time debug program. have feeling interested in making many liveusb java program installed. since dd not option, guess it's more meaningful somehow use kickstart procedure quick liveusb installations , copy java things. thanks.
Comments
Post a Comment