LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Puppy
User Name
Password
Puppy This forum is for the discussion of Puppy Linux.

Notices


Reply
  Search this Thread
Old 01-13-2015, 06:28 PM   #1
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Rep: Reputation: 169Reputation: 169
Script does not work when place in Startup directory


I have this in my Startup directory, but it never starts.

Anyone know why ?

Script works fine from a console.

#!/bin/bash
#
#
#
#
/usr/bin/seamonkey
 
Old 01-13-2015, 06:29 PM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
i usually put startup commands in my ~/.bash_profile or ~/.profile.
 
Old 01-13-2015, 06:40 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,276
Blog Entries: 24

Rep: Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224
A better place might be to include that in your ~/.xinitrc or your DE's startup script (ex: ~/.fluxbox/startup). That way it is explicitly tied to your current X session.
 
Old 01-13-2015, 07:02 PM   #4
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
I put the command in .profile but it does not start seamonkey.

Quote:
#120221 moved this code here from /etc/profile, also take 'exec' prefix off call to xwin.

if [ ! -f /usr/bin/X ];then
#v2.00r1 now support a text-mode-only puppy...
if [ -f /usr/local/bin/elinks ];then
if [ ! -f /tmp/bootcnt.txt ];then
touch /tmp/bootcnt.txt
#exec /usr/local/bin/elinks file:///usr/share/doc/index.html
#/usr/local/bin/elinks file:///usr/share/doc/index.html & #110804 110807
/usr/local/bin/elinks file:///usr/share/doc/index.html
fi
else
echo
echo "\\033[1;31mSorry, cannot start X. Link /usr/bin/X missing."
echo -n "(suggestion: type 'xorgwizard' to run the Xorg Video Wizard)"
echo -e "\\033[0;39m"
fi
else
if [ -f /root/.xorgwizard-reenter ];then #130423 see /usr/sbin/xorgwizard-cli 130513 also see init (in initrd)
xorgwizard-cli
fi

/usr/bin/seamonkey

#want to go straight into X on bootup only...
if [ ! -f /tmp/bootcnt.txt ];then
touch /tmp/bootcnt.txt
# aplay -N /usr/share/audio/bark.au
dmesg > /tmp/bootkernel.log
#exec xwin
#xwin & #110804 110807
xwin
fi
fi
 
Old 01-13-2015, 08:58 PM   #5
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,276
Blog Entries: 24

Rep: Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224
Quote:
Originally Posted by Fixit7 View Post
I put the command in .profile but it does not start seamonkey.
I will not comment on the code that you posted, as I am not sure I understand how or why you did it that way.

But it is entirely possible that your ~/.profile file is not being executed.

Do you have a ~/.bash_profile file? If so, from man bash...

Code:
INVOCATION
       A login shell is one whose first character of argument zero is a -, or  one  started  with  the  --login
       option.

       An  interactive  shell is one started without non-option arguments and without the -c option whose stan‐
       dard input and error are both connected to terminals (as determined by isatty(3)), or one  started  with
       the  -i  option.   PS1  is  set  and  $- includes i if bash is interactive, allowing a shell script or a
       startup file to test this state.

       The following paragraphs describe how bash executes its startup files.  If any of the  files  exist  but
       cannot  be read, bash reports an error.  Tildes are expanded in filenames as described below under Tilde
       Expansion in the EXPANSION section.

       When bash is invoked as an interactive login shell, or as  a  non-interactive  shell  with  the  --login
       option,  it  first  reads  and executes commands from the file /etc/profile, if that file exists.  After
       reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads
       and  executes  commands  from  the first one that exists and is readable.  The --noprofile option may be
       used when the shell is started to inhibit this behavior.
You will also need to background seamonkey for the startup script to continue.

Last edited by astrogeek; 01-13-2015 at 09:02 PM.
 
1 members found this post helpful.
Old 01-13-2015, 11:27 PM   #6
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
I forgot to do this with my script. :-)

chmod +x *.sh

Is the reason that .sh files are not executable by default for security reasons ?

I know that scripts can wipe out the O.S. rather easily as I have often found out.

Thank God for backups. :-)
 
Old 01-14-2015, 12:50 AM   #7
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,276
Blog Entries: 24

Rep: Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224
Quote:
Originally Posted by Fixit7 View Post
Is the reason that .sh files are not executable by default for security reasons ?
Under *nix, the filename extension has no relevance to whether it is executable or not, only the executable bits matter.

A .txt file can be made executable, and a .sh file can be made non-executable, filename extension has no part in determining the executable status.

So, they are not executable by default for the reason that any newly created text file is not executable - because there is no reason for it to be! In that respect it is a safety, or security, default.

If it is a script that should be executable, you must set the executable bit without regard to extension.

Hope that helps!
 
Old 01-14-2015, 01:52 AM   #8
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Vielen Dank Astrogeek.

Are you trying to obfuscate your signature ? :-)

Quote:
Distribution: Slackware [64]X{.0|.1|.2|-current} ::X>=12<=14, FreeBSD_10{.0|.1}

Last edited by Fixit7; 01-14-2015 at 01:53 AM.
 
Old 01-14-2015, 02:18 AM   #9
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,276
Blog Entries: 24

Rep: Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224
Пожалуйста Fixit7!

It was supposed to be clever, but obfuscated is good enough!

Something done as a distraction. Actually, it isn't even correct, been meaning to fix that!

Last edited by astrogeek; 01-14-2015 at 02:21 AM.
 
Old 01-14-2015, 02:59 AM   #10
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Is this Russian or more cleverness ??

Пожалуйста Fixit7!
 
Old 01-14-2015, 12:46 PM   #11
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,276
Blog Entries: 24

Rep: Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224Reputation: 4224
Quote:
Originally Posted by Fixit7 View Post
Is this Russian or more cleverness ??

Пожалуйста Fixit7!
Yes, Russian. I had to google translate the German, and would have had to reverse translate my response, so instead I gave you something to translate... and gave myself an excuse to use my recently learned Russian...

Пока!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Startup script cant work cghcgh Linux - Newbie 9 04-23-2008 03:24 AM
Creating script to change ownership directory on RHEL4U3 at startup Ferianto Linux - Enterprise 9 02-13-2008 10:01 PM
script doesn't work during startup of the pc shipon_97 Linux - Enterprise 3 04-30-2007 12:38 PM
Startup Script Doesn't Work. jonwatson Linux - Newbie 2 03-24-2006 08:55 AM
Where is system's startup script directory william43 Linux - Newbie 4 07-11-2003 12:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Puppy

All times are GMT -5. The time now is 12:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration