I have written a bash script (as part of a bigger project) which is run via a init.d process following a system reboot.
The script is intended to just run once, and is then deleted, but some of the commands in the script take a long time to execute - such as extending the partition filesystem (resize2fs), and I've found that after 5 minutes, the script 'times-out' and stops running.
It seems coincidental that others have experienced similar issues, and comments suggest that it may be due to "systemd waited five minutes for the program to daemonize itself, and it never did"??.
I've attached the script, which is placed in init.d, and of course run 'update-rc.d resize.once defaults'.
Any help would be appreciated in keeping this script running!
The system log shows;
Feb 28 15:54:35 emonpi resize_once[400]: Starting resize_once, THIS WILL TAKE A LONG TIME!:e2fsck 1.42.12 (29-Aug-2014)
Feb 28 15:54:35 emonpi resize_once[400]: Pass 1: Checking inodes, blocks, and sizes
Feb 28 15:54:38 emonpi resize_once[400]: Pass 2: Checking directory structure
Feb 28 15:54:38 emonpi resize_once[400]: Pass 3: Checking directory connectivity
Feb 28 15:54:38 emonpi resize_once[400]: Pass 4: Checking reference counts
Feb 28 15:54:38 emonpi resize_once[400]: Pass 5: Checking group summary information
Feb 28 15:54:39 emonpi resize_once[400]: /dev/mmcblk0p3: 202/51400 files (12.9% non-contiguous), 38298/204801 blocks
Feb 28 15:54:39 emonpi resize_once[400]: resize2fs 1.42.12 (29-Aug-2014)
Feb 28 15:59:31 emonpi systemd[1]: resize_once.service start operation timed out. Terminating.
Feb 28 15:59:31 emonpi systemd[1]: Failed to start LSB: Run resize_once on boot.
Feb 28 15:59:31 emonpi systemd[1]: Unit resize_once.service entered failed state.
(Right click on image - select new tab to view)