General TC > Remasters / Remixes - Unofficial

Having a bit of an issue remastering with perl startup script

(1/1)

initialhit:
Greetings!
I've done a large amount of google fu work, looked on here, and obviously follow this guide: http://wiki.tinycorelinux.net/wiki:remastering

here's my bootlocal.sh (I know I don't have to indirectly call perl, but doing this so I can add bash system commands later)


--- Code: ---#!/bin/sh
# put other system startup commands here
/opt/login.sh

--- End code ---

here's login.pl ( a couple of scrubbed items)


--- Code: ---#************************
# Written by Shades
# Description: This script simply pops open a firefox window for whitelisting, and
# once they close firefox, it will reboot them.
# This Script is built in such a way that it doesn't require any libraries to be
 brought in.
# Input / Output: None\

# Usage: Startup script to be put in rc.local, etc. on boot start.
# Version: 0.2.1
#************************

#---------
# Grab libraries needed that are included in base OS
#---------

use strict;

#---------
# Declare variables and set initial values
#---------

my $mac = `cat /sys/class/net/eth0/address` or die("Not a valid Linux system!");
 # Grab the mac from the mac file
my $url = 'https://internalwebsite/?mac=' . $mac;
my $statuslength = 10;
my $status = '';
my $verbose = 0; # Set to 1 if you want verbosity for troubleshooting

#--------
# Open Firefox and detect when it's done
#--------
system("firefox $url &") or die("Erroring running firefox command!");

# Commenting out the below until testing proves above will not move forward unti
l completed.
# Will be deperacated in version 0.3.0
#while ($statuslength > 2) {
# $status = `ps -eflno | grep -i firefox | grep -vi "grep"`;
# $statuslength = length($status); # Grab length of response, should be 1
if close for \n
# if ($verbose = 1) {
# # Output the verbose features here for this routine.
# print "Length of ps return: " . $statuslength;
# print "ps response: " . $status;
# }
# sleep 3; # To try and save on some memory / processing by sleeping for 3
 seconds.
#}

#--------
# Reboot system (into PXE?)
#--------
system("sudo reboot");
--- End code ---

My issue is it throws this error after loading extensions:

--- Code: ---mount: can't setup loop device: No space left on device
--- End code ---

and  afterwards throws similar errors for each plugin. My perl script has been test on my normal TC box, and throws no errors / runs as expected when ran manually (not included in bootlocal.sh).  Any ideas as to why it does this when included in bootlocal.sh? Is it trying to run all these scripts before X startup? If so, how do I get it run automatically after X startup?  Cron spool file? Appreciate any help and hope the script gives ideas to any one else :)

gerald_clark:
bootlocal.sh runs in background, and may or may not finish before X starts, but it cannot access the X window anyway.
If you want it to run under X then you need to put it in ~/.X.d.

initialhit:
 :P thanks for the quick reply, was afraid of that. Do I just drop the shell (perl maybe?) file in there?

I found out the issue was not  with my script anyways. Just unpacking and rebuilding the image according to the instructions given came up with the same result.  Curious if it's a ubuntu trying fishy things again.

UPDATE:
I realize this time it was an issue with permissions. This system is kind of finicky with permissions.

UPDATE2:
back to having the memory leak / loop issue from even normal unpack and repack with no mods. ugh.

initialhit:

--- Quote from: gerald_clark on November 24, 2014, 07:00:06 PM ---bootlocal.sh runs in background, and may or may not finish before X starts, but it cannot access the X window anyway.
If you want it to run under X then you need to put it in ~/.X.d.

--- End quote ---

Can you point me to a good resource on this X script? Still need to get this thing running.

gerald_clark:
Please read the book.
http://tinycorelinux.net/book.html

Navigation

[0] Message Index

Go to full version