Click here to Skip to main content
15,904,503 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I created one init.d script to run my C++ daemon using /etc/init.d/skelton script from ubuntu. and installed the new script using "update-rc.d myservice defaults 99" command its working perfectly. Now I want to create two more shell scrits one needs to run at the beginning of the boot as possible and to execute some commands and restart at the end(because it will save much more time at the first boot)


I want to execute this script at the beginning of first boot from a new init.d script

SETTINGSDIRPATH="/etc/Accutrac"
PARTITIONEXPAND="/PartitionExpand"
PARTITIONVAL=$SETTINGSDIRPATH$PARTITIONEXPAND

if [ ! -d "$SETTINGSDIRPATH" ]; then

   mkdir -p "$SETTINGSDIRPATH"
	
fi

if [ ! -f $PARTITIONVAL ]; then

		echo 0 > "$PARTITIONVAL"
	fi

PARTEXPANDED=$(<"$PARTITIONVAL")

if [ "$PARTEXPANDED" == "0" ]; then #expand root partition if status flag=0

	/boot/raspi-expand-rootfs.sh      #script tp expand root partition	
	echo 1 > "$PARTITIONVAL"      	#change status flag=1
	shutdown -r now 		#restart system to make the changes affect 
fi  



what are the steps needed to make a new script that will run this script at the beginning of boot before starting other scripts.


My another init.d script needs to run at the last step of boot after establishing Ethernet connection and assigning an IP address
Posted
Updated 4-Dec-13 20:11pm
v2

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900