Execute a script as a non-root user at boot time. The script lives in /home/sbrown/scripts and has the executable bits set. If I run the script locally in the shell it behaves as normal, but will not at boot time It's a very simple 2 line script:
#!/bin/bash
# Starts IRSSI in a screen session
sudo -u sbrown screen -S irssi irssi
Here's WHAT DOESN'T work:
I put this in /etc/rc.local: sudo -u sbrown /home/sbrown/scripts/irssi_exec I also tried just copying the script to /etc/init.d/ and chowning it to root then ran update-rc.d irssi_exec defaults and rebooted. Still not working. This is on a Debian Squeeze box... what am I missing? Surely it should be simpler than this
I wanted to use cron to play a media file at a certain time (i.e. use it as an alarm clock). However it seems to do nothing. The contents of my crontab is:
I have just installed ssh-server in my Ubuntu 10.04, and really want to know how to enable/disable it and I also want to be sure if the changes will take effect after the next boot or not, and how to do that?
I need to start an application (graphical) when the PC start, even before anybody login, and use/launch a specific user. Now only can do this manually; when gdm starts, switch to any text tty [ie. Ctrl + Alt + F1], then I login into the special user, start a X server, export the DISPLAY environment variable, and start the application.
With this steps: Code: $X :1 -verbose -nr -nolisten tcp & # Maybe Metacity -> $ metacity $export DISPLAY=:1 $JavaApp & Now i need put this steps (script) in some place to launch the app automatically, and with and specific user [ie. manager].
How can I made it? Maybe in init.d? or an special xinitrc? And how can start the app with the specific user? And, if is possible, who can stop the app when the system going turn off? I have Debian 5.0 and a beginner knowledge of shell script.
I am writing one simple server daemon and running with /etc/init.d/server its running properly but when i want to run one simple QT GUI with system() function , its not able to run it and returning 256 as return code .
If same daemon i m running from terminal then its working properly and also system() function is getting success with return value 0 and GUI is getting popped up.
I am writing one simple server daemon and running with /etc/init.d/server its running properly but when i want to run one simple QT GUI with system() function , its not able to run it and returning 256 as return code .
if same daemon i m running from terminal then its working properly and also system() function is getting success with return value 0 and GUI is getting popped up.
im searching for this answer now a pretty long time and i know that many similar questions where asked and i all looked themIm trying to run a the command "vncserver" on our opensuse11.2 server when its booted.many posts here endet in "put a sh script into your /kde4/Autostart" but that didtn help for me because the server runs without a screen and normally nobody is logged in. When i logged in that worked fine.i also tried to add the command "vncserver" to "/etc/init.d/boot.local " but that didnt work too. i think its to early executed to work.i also tried to activate the service to start up at boot with chkconfig vncserver start but the service vncserver is "unknown". when i type vncserver into the console after logging in everything is alright.you see i really tried a lot and searched a long time at google and in this forum but nothing worked
I was running openSUSE 10.3 using yast2-firstboot and everything worked perfectly. I have since upgraded to 11.2 and after a post on this forum I was able to get yast2-firstboot to run. The control file was moved to touch /var/lib/YaST2/reconfig_system instead of touch /etc/reconfig_system. All is well there and firstboot does run. I have a script that basically sets up the hostname, IP addresses, etc on the machines. This worked in 10.3 but in 11.2 it doesn't execute. I can manually run the script which I have defined in the /etc/sysconfig/firstboot file. The SCRIPT_DIR="/usr/share/firstboot/scripts" I noticed a new entry this file labeled - # Action that should be done after the firstboot sequence finishes.
FIRSTBOOT_FINISH_ACTION="" Should I place my script here? I read the doc and you can use reboot but need my script to run first. To I just put the name of the script or the entire path to the script if that is the place to put it. On a side note. Does anyone know where the default FIRSTBOOT_FINISH_FILE="" is located? I want to use that as a template but change and add a few lines to this. I just can't locate it anywhere on the system.
hi! everyone does anybody experience this? i have ubuntu server, php5, apache2. every time i visit my website the script is not executed by my apache instead it will downloading my script with application/x-httpd-php file type. how can i fix this?
I'm booting Gentoo off of a usb-stick. This has been working previously but now when I try to boot my stick it gets as far as executing the initramfs init script then restarts.The last two lines of my initramfs/init are:
I have a php script that i made to check if the internet is working and if not, it should execute a command that starts a service on my server (service jistarter start), and i want to run it every 3 minutes, so i added it to the crontab, this is how it looks:
The problem is that cron isn't executing it or something.. i don't know but the service it was intended to start, doesn't start.
The thing is that the script runs fine when i run it myself, in all the 3 methods it woks fine: "/usr/bin/php /srv/checkping.php" or "php /srv/checkping.php" or "/srv/checkping,php" (it has chmod 755):
When booting Fedora 11, my system hangs for a very long time on starting udev. Sometimes I get an I/O error. However, my hardware is fine. I do eventually get in to the system.
I am writing a script which will fetch data from different machines and display it on single terminal. I have created a file named SERVERNAMES containing ip address of machines I need to monitor. Then for every IP I am issuing ssh command to get date on that machine. However When I am trying it on the script it is just giving me output of first server and it is ignoring rest servers mentioned in file. ssh works fine without password for all machines mentioned in SERVERNAMES.
Code: #!/bin/bash while read line do #Calculate Load on remote machine. Date=`ssh -T -q $line date` echo "Date on $line is:$Date" done < SERVERNAMES
Code: output. Date on 10.180.8.231 is:Wed Jul 14 10:48:46 IST 2010 I am not getting the output for . Code: 10.180.45.235 10.180.45.238 10.180.45.211 Is there anything wrong in ssh?
I am using squid 2.6 on my cent os 5 .I want to shutdown the system at 7:00 pm for that purpose I write in# crontab -e 0 19 * * * /sbin/shutdown -h nowThe thing which I want to clear that when the system will going to turn off it will also stop squid service? If not then how can I automatically stop squid service and then crontab file execute
I have several file servers in our offices and I am relatively new to Ubuntu / Linux. I get notices that there are updates for the server software from time to time. Is it typical to update everything when available or should I follow "If it ain't broke, don't fix it..." mentality?I would hate for everything to be working fine and then have an update throw me a curve.
I am hosting two Virtual Servers both running Centos 5.3 on a host machine also running the same OS. The VM software in use is Xen, as supplied with the OS.The host machine's time and date is fine, however both Virtual Servers are running ahead of real time consitantly.Running /etc/init.d/ntpd restart will resolve the issue however one of these is running MailScanner and when the time suddenly goes backwards, sometimes by as much as an hour, it stops working properly.
I have a set of machines on a disconnected network. Periodically, one of the machines connects to the internet and synchronizes its time with a time server that is not known until the connection is established. (The machine queries a central command server for the address of the time server it should synchronize to.)
I then use a custom tool to do some calculations to call adjtimex() and adjust the clock so that it runs fairly accurately.
I know ntpd is supposed to be able to handle disconnected networks but I thought you had to preconfigure the servers in the configuration file.
My intent is to run ntpd on this machine (without configured "server"s) so that it can serve time to the internal network. (Periodic synchronization using ntpdate from the internal machine to the bridge machine.)
The problem: ntpd wants to fuss with the values I set using adjtimex(). I want it to quit thinking it needs to adjust the clock and just serve time to the internal network. (Maybe I have a GPS time source hooked directly to the machine!)
logging in a server through putty in the same network when i executed last command its showing system ip logged in time and logged out time the output as followsthis is my system oot pts1 xx.xx.xx day month date time in time out timeand similarly am geeting other than this likeroot :0day month date time still logged in this is from more than 3 days its logged in
I've been a long time Windows user, but I've started a small firm and because of lack of funds, I've decided to install Ubuntu on my company's PCs.I have 8 PCs in total - 6 of them with Intel CPUs, and the last two with AMD CPUs. I bought the extra two computers because I've managed to find an extra two people to work at my company, and AMD-based PCs are cheaper so I've decided to buy them instead of Intel.Long-story short, I've installed Ubuntu 9.10 and boot time takes about half-an-hour. After the computers finally boot, USB hardware doesn't work at all. I was forced to buy PS/2 keyboards & mice and they both work fine after the PCs boot.I don't know what's causing this delay.I've enabled Cool 'n Quiet from BIOS.I've tried several instructions like editing the /etc/modules file.I've installed cpufreqd, tried to configure it, but it didn't work.I've check the CPU stats and my CPUs are running at 800MHz. I can't believe nobody managed to fix the 800MHz problem as I've noticed it's quite common among AMD Ubuntu users. I think I've tried almost anything that I've found on this forum.I can't keep asking my employees not to reboot their PCs. Both Chrome/Firefox crash a lot on Ubuntu so they're forced to restart their computers.The computer specs are: AMD Athlon II X2 240 dual-core @ 2.800MHz, 2GB RAM, 500GB HDD, etc.
This on a Vostro 1220 Laptop w/ Intel 5300 wireless:
A.I have long boot up time.I think it's because of the eth0 network search which I don't use.I have an intel wireless 5300 card running.How can I speed up the boot time, i.e. disable or change the eth0 at boot, the searching?
B:When I restart or shutdown, the screen flashes repeatedly and gets some garbled colors along the top before finally rebooting looks like windows ME or something).This vostro has an intel x4500HD vid chipset in it.
C.How do I get into gnome configuration editor to turn on Metacity compositing? Alt-F2 and run gconf-editor doesn't do it. I don't do compiz, but need compositing.
D.I need to install Chromium Browser as it sync my bookmarks.I have RPMforge enabled btw also...how can I do that? I.e. rpm repo for chromium?
This will help me get off to a running start so I can get up to speed on CentOS..
I am having dual boot system(windows 7 and Fedora 12).When i switch on my system.It show the the timer 3 sec in order to get boot selection window(means window which asks that what to start fedora 12 or windows 7).I want to increase this time from 3 to 10 sec.