LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Am I missing something when it comes to /etc/rc.local? (https://www.linuxquestions.org/questions/linux-general-1/am-i-missing-something-when-it-comes-to-etc-rc-local-627844/)

Jongi 03-24-2008 05:11 PM

I think it is X dependant only if I have the option that needs libnotify enabled. In fact I am pretty sure that is the case.

kcoriginal 04-17-2008 08:55 PM

"chmod" command...

This is one of the biggest frustrations of my Linux life!

scripts you create from scratch ALWAYS need to be made 'executable' in order for Linux to run them.

"chmod" is pretty easy to learn and is found in Chapter 2 of most Linux reference books...

...but, basically... 777 means setting Read/Write/and Execute for all users and groups of your system.

By default, newly created text files (aka newly created scripts...) have Read/Write persmissions set, but not Execute... I believe that equates to a chmod of 551

"chmod 777 hellanzb.py" (without the quotes, from inside the directory where the file is located) should do the trick... although... "chmod 751 hellanzb.py" or "chmod 711 hellanzb.py" is probably safest



God I hope this saves someone frustration... I would be LIGHT-YEARS ahead in learning Linux if I had found that sooner!

Jongi 05-03-2008 07:20 PM

Your chmod anecdote is interesting. However hellanzb.py was always executable. Even as a normal user. See post 7 to see that it already has the executable attribute. The issue lay firmly with the fact that it needed an X environment to run due to one of the options I chose in its configuration.

kcoriginal 05-05-2008 10:30 AM

Quote:

Originally Posted by geniushasan (Post 3088974)
Jongi
are u setting 777 i mean are u giving the executable permission ?
it needs to begin with S --> inorder to start
and then the process number -- > 97 for example | inorder to initiate the process with the priority as a number.


S97filename | make sure its 7xx



When you responded that you didnt have a clue what he was talking about here... I figured I would share this eureka moment... just in case!

regards

kc

Jongi 05-18-2008 02:29 PM

So Debian doesn't have the folder /etc/X11/xinit/xinitrc.d/ . It does however have the file /etc/X11/xinit/xinitrc . So I thought adding the line /usr/bin/hellanzb -D to it would see it working. However the daemon does not start in Debian. Again the same command works from the command line once Debian is up and running.

Code:

[root:~#] locate hellanzb | grep bin
/usr/bin/hellanzb
/usr/share/python-support/hellanzb/Hellanzb/NewzbinDownloader.py
[root:~#] ls -la /usr/bin/hellanzb
-rwxr-xr-x 1 root root 1942 2008-01-05 01:04 /usr/bin/hellanzb
[root:~#] cat /etc/X11/xinit/xinitrc
#!/bin/bash
# $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $

# /etc/X11/xinit/xinitrc
#
# global xinitrc file, used by all X sessions started by xinit (startx)

# invoke global X session script
. /etc/X11/Xsession

#HellaNZB
/usr/bin/hellanzb -D
sleep 10

There even wasn't a 10 second pause anywhere

PTrenholme 05-18-2008 04:09 PM

Well, the script wouldn't get to your addition before the X session had terminated, eh? So you might see a 10 sec. delay before your logoff is processed/

Jongi 05-18-2008 11:33 PM

While I know they are not the same, in Sidux the exact same script worked. That is, the hellanzb process is running when X I am in an X session.

Jongi 05-19-2008 05:05 PM

Added /usr/bin/hellanzb -D to ~/.xinitrc. No help. The most promising result was when I added the line to ~/.xsession. Except that it ignored the fact that the system is meant to auto login. And it came up with a different login screen. When I wen tto console from there, hellanzb was running. So it was close, close but no cigar.

bsdunix 05-19-2008 08:40 PM

Quote:

Originally Posted by kcoriginal (Post 3124740)
scripts you create from scratch ALWAYS need to be made 'executable' in order for Linux to run them.

This is not "ALWAYS" true. You can execute a script from the command line without the shebang command interpreter line at the top of the script and without executable bit set on the script file, but the calling command interpreter must preceed the script file name.
Code:

user@mybox:~$ cat /home/user/scriptfile
echo "This is a test"

user@mybox:~$ /bin/sh /home/user/scriptfile
This is a test

user@mybox:~$ /bin/csh /home/user/scriptfile
This is a test


Jongi 05-20-2008 02:55 PM

I also tried adding the line to /etc/X11/Xsession but that didn't work either


All times are GMT -5. The time now is 03:51 AM.