Hemtah Posted December 16, 2004 Report Share Posted December 16, 2004 (edited) hi, don't know if this go on hardware or software i am using accessrunner with a usb modem to start my internet connection i have to type su and cxstart.sh on the command line, how can i have my internet connection start while linux starts? thanks Edited December 20, 2004 by Hemtah Quote Link to comment Share on other sites More sharing options...
Gowator Posted December 16, 2004 Report Share Posted December 16, 2004 Everything which is automatically started is in a directory called /etc/init.d Now hopefully there is a stub of a script here.... that you can use that relates to your service.. Have a look or post the contents here so we can see,,,, after that you make a link to it in the directories /etc/rcx.d (where x is a number 0-5) that can be done easily using a script called chkconfig ..but first show us what the script is then we can have a look .... its not difficult but its easier to expllain if we know we have the right file.. if it doesn't exist we can make one from the cxstart.sh so all it not lost :D Quote Link to comment Share on other sites More sharing options...
Hemtah Posted December 16, 2004 Author Report Share Posted December 16, 2004 well well, i am newbie on mandrake linux and i am just doing the full transition from windows to linux so in my dir /etc/init.d i have alsa harddrake mandrake_everytime nfs proftpd usb atd hotplug mandrake_firstime nfslock rawdevices xfs cpufreq httpd messagebus numlock single xinetd crond keytable mtink oki4daemon smb dkms kheader mysql partmon sound dm killall netfs portmap sshd functions mailman netplugd postfix syslog halt mandrake_consmap network postgresql udev but which one to use? Quote Link to comment Share on other sites More sharing options...
Hemtah Posted December 16, 2004 Author Report Share Posted December 16, 2004 or is it possible to a batch file? and put a link on desktop ? if someone has a clue please give a hand. Quote Link to comment Share on other sites More sharing options...
Gowator Posted December 16, 2004 Report Share Posted December 16, 2004 The .sh file is the same as a batch file.... hint... you can use the middle mouse button to copy and paste highlighted text to you can ls /etc/init.d ...then use the middle mouse to copy it and save typing :D if you find the file cxstart.sh (whereis cxstart.sh) then cat /pathtofile/cxstart.sh ... it should show up in the terminal..... can you copy and paste it... ? we can do the other way with an icon but it will depend which window manager you are using etc. and your first instainct was a better neater way :D indeed once you have that it is called a service .. and you can use the service to stop or start it. Quote Link to comment Share on other sites More sharing options...
Hemtah Posted December 16, 2004 Author Report Share Posted December 16, 2004 thanks a lot i am using the command line i have copied the file from his directory to the one you specified me. also in /etc/ there is a file called cxacru.service what is it? and what is it used for? Quote Link to comment Share on other sites More sharing options...
Gowator Posted December 16, 2004 Report Share Posted December 16, 2004 thats cool its probably the right file.... This can probably be put into /etc/init.d just use cp.... it would be helpful if you can post this file Quote Link to comment Share on other sites More sharing options...
Hemtah Posted December 16, 2004 Author Report Share Posted December 16, 2004 well, still hace trouble with my firefox shortcut, need to find out which file to link to the shortcut i have rebooted but i am not connected, i have to do it manually. here is the file #!/bin/bash TEXTDOMAIN=`basename $0` #if [ -d "./locale" ]; then # TEXTDOMAINDIR="./locale" #fi . /etc/cxacru cxload.sh || exit 1 if [ "$1" = "service" ]; then if [ -d /var/lock/subsys ]; then touch /var/lock/subsys/cxacru fi fi if [ "$PROTOCOL_MODE" = "" ]; then echo $"Error: PROTOCOL_MODE not defined" 1>&2 exit 1 else if [ "$PROTOCOL_MODE" -eq 1 ]; then echo $"Setting RFC1483/2684 routed..." cxnetup.sh || exit 1 else if [ "$PROTOCOL_MODE" -eq 2 ]; then echo $"Setting PPP over ATM..." cxnet2up.sh || exit 1 else if [ "$PROTOCOL_MODE" -eq 3 ]; then echo $"Setting RFC1483/2684 bridged..." cxnet3up.sh || exit 1 else if [ "$PROTOCOL_MODE" -eq 4 ]; then echo $"Setting PPP over Ethernet..." cxnet4up.sh || exit 1 else echo $"Error: unknow protocol mode" 1>&2 exit 1 fi fi fi fi fi Quote Link to comment Share on other sites More sharing options...
Gowator Posted December 16, 2004 Report Share Posted December 16, 2004 OK that looks OK... If you know which protocol you use we could simplify it though :D However if you copy this into the /etc/init.d directory then you should be able to use chkinstall to set which runlevels It needs some work because it should also have a stop... we can then use this in the icon with a script like #/bin/bash #start/stop internet if [/var/log/sussys/cxacru ] cxload.sh else cxunload.sh fi This sees if the lock file exists and runs a file I called cxunload.sh to stop it so the same icon will start and stop the service... Can you post the contents of cxstart.sh also do this (as root in CLI) updatedb locate cx This will find anything else with cx.. (this file needs to be in the path) hopefully a cxunload.sh (or similar already exists :D) and we can use this ... Quote Link to comment Share on other sites More sharing options...
Hemtah Posted December 16, 2004 Author Report Share Posted December 16, 2004 thanks again for helping me well: the protocol i use is pppoatm there is file called cxnet2down.sh which is adviced to be used to shutdown the net connetion #!/bin/bash TEXTDOMAIN=`basename $0` #if [ -d "./locale" ]; then # TEXTDOMAINDIR="./locale" #fi echo $">>> Down PPPoA network interface <<<" echo pid=`pidof pppd` if [ "$pid" != "" ]; then echo $">>> Killing pppd daemon..." killall pppd echo fi if lsmod | cut -d' ' -f1 | grep -q -E "^cxacru|cxacrudbg$"; then echo $">>> Stopping transfers..." cxioctl 2 echo fi Quote Link to comment Share on other sites More sharing options...
Gowator Posted December 17, 2004 Report Share Posted December 17, 2004 I didn't get hoe last night! Live music then stopped at friends so sorry I didn't get nback... (p.s. anyone else wanna step in gfeel free else Ill try later) to anyone who might help before I get chance) My idea is just make a initd service from this with the start/stop/etc. use chkconfig to add the service to RL2-5 and appopriate kill services ... then also add a script that turns it off if its on on on of its off based on lock file! Quote Link to comment Share on other sites More sharing options...
Hemtah Posted December 17, 2004 Author Report Share Posted December 17, 2004 i think u forgot that i am a newbiiie Quote Link to comment Share on other sites More sharing options...
Gowator Posted December 17, 2004 Report Share Posted December 17, 2004 i think u forgot that i am a newbiiie Nope I was posting that so someone else will be able to follow where I was going. Hopefully helping you quicker since I need to get home to check... (I don't wanna tell you wrong and screw something up so I wanna test it on my machine 1st ).. but someone else might be able to help you sooner so I posted where I was aiming for... Thats why I added it all underneath... don't worry about understanding it :D (at least not yet) Quote Link to comment Share on other sites More sharing options...
Hemtah Posted December 17, 2004 Author Report Share Posted December 17, 2004 anyway thank for your help, it's not an emergency :-) Quote Link to comment Share on other sites More sharing options...
Hemtah Posted December 20, 2004 Author Report Share Posted December 20, 2004 Solved by in cxacru make add_service then i have made a link on my desktop of cxnet2up.sh :-) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.