[SOLVED] HOW TO: run command(s) as root at startup ?
Hello,
Can anyone explain or at least point me to a noob-friendly source as to how this is done ?
Thanks in advance.
Last edited by Crow1991 (2013-10-14 09:24:13)
How can I make a script start during the boot process?
https://wiki.archlinux.org/index.php/Sy … process.3F
Similar Messages
-
[SOLVED] How to run commands during logoff?
Hi there,
Am trying to run the command "alsactl store" upon logoff so my volume levels are stored when I LOGOFF (which I assume will also apply to restarts and shutdowns too???). But I can't seem to find the necessary rc file...
Any help would be great!
Cheers,
KC
Last edited by killercow (2008-08-30 00:46:01)If you are talking abt. logging off from bash/konsole, there is no file [in my head ] that we can insert our own commands into.
Logging out of a DE session should 've their config files, but I don't know them -
How to run command SQLLoader Oracle in c#
Hello,
How to run command SQLLoader Oracle in c#. I try my sourcode for run this SQLLoader, but nothing happen and error "No process is associated with this object.". Please tell me how i fix it. Thanks.
This is my code:
System.Diagnostics.Process process1;
process1 = new System.Diagnostics.Process();
process1.EnableRaisingEvents = false;
string strCmdLine;
strCmdLine = @"/C SQLLDR XL/secreat@O11G CONTROL=E:\APT\LoadXL.ctl";
System.Diagnostics.Process.Start("CMD.exe", strCmdLine);
process1.WaitForExit();
process1.Close();jesperdj ,thanks:)
actually,i am using eclipse to run my ant tasks programmatically,but I got trouble with the AntRunner class.it seems that i should config a proper classloader for it,but i just don't know how.please lend a hand:)thanks
robin -
[Solved]Run shell script as root on startup
Hi
How to start shell script as root on startup?
When i search online it is all about an rc.local, but I do not have a rc.local, and when I make one myself it does not run the shell script.
Regards
Frederik
Last edited by Fred7109 (2015-05-26 20:13:04)Thankyou for the answers, I went into problems so could first answer now. The script is supposed to delete sandboxes I have created with the sandfox script, and also start a new sandbox with sandfox.
Regards
Frederik -
[SOLVED]Unable to run Graphical applications as root/sudo
Ok so ive been working on getting my very first Arch install up and running and I need to get the catalyst drivers running for my HD6850 because I plan on doing some wine gaming.
So I followed the instructions here on the wiki for ATI catalyst and I now have the drivers up and running, tried glxgears and everything is fine. The issue I am having Is that when I go under the settings menu in KDE I have the "AMD Catalyst control center" there, however I do not have the (Administrative) option that I get with all other distros. I need to run the CCC as root to beable to configure my multiple monitors.
In a terminal when i enter;
sudo amdcccle
It returns with the following;
No protocol specified
amdcccle: cannot connect to X server :0
So after a little digging I found this thread on the ubuntu forums that was quite helpful;
http://ubuntuforums.org/showthread.php?t=307984
So I ran
DISPLAY=:0.0 xhost +
then tried again to run
sudo amdcccle
and like magic it worked and I was able to configure my displays.
However this is not a permanent fix. Can anyone see a more permanent solution to this issue? This affects more than just the Catalyst Control Center; It stops me from running any graphical application as root or with sudo. Also can anyone explain what is causing the issue?
I have searched to the best of my ability and as you can see I have for the most part fixed the issue, however I cannot seem to find a permanent fix, nor do I really know what caused the issue to begin with.
Last edited by relik (2011-07-03 20:21:52)SOLVED
I took your advice about installking something like gksudo, and rememberd that on my kubuntu install I had something called kdesu. So Since im running KDE and not Gnome, I did some searching and found out how to install kdesudo using the AUR.
Just followed the install guide here for Yaourt ---> https://wiki.archlinux.org/index.php/Yaourt
Once I did that i just ran
yaourt kdesudo
selcted #1 and installed.
Now when I need to run a GUI based app as root I type in
kdesu <NAME OF APP>
So to solve my original issue I just run
kdesu amdcccle
instead of
sudo amdcccle
This seems to work for any app that needs to be ran a root with a GUI.
Also if your like me and you want to beable to just open CCC from your kickoff menu then do the following;
1. Right click kickoff > edit applications
2. Go to "Settings" > ATI Catalyst Control Center
3. In the Command Field add "kdesu" without quotes to the begining of the line so it looks like this
kdesu amdcccle
4. Save
Last edited by relik (2011-07-03 20:22:55) -
How to run commands upon system boot as user?
How can I as a user run commands upon system boot? In Vixie's cron, one can use the @reboot syntax in a crontab, and the job is ran every time the cron daemon starts. Arch however, uses Dillon's cron which seems not support this feature.
bwalk wrote:Hmm, does not work, because root owns init, so everything requires root. stb's version is valid, the -s parameter drops privileges to <USER>, spawns a shell and executes <COMMAND>. So, no security problem whatsoever.
So there is nothing like @reboot in vixiecron? -
URGENT-How to run command in java application???
URGENT!
i would like to run command to invoke some applications (like invoke application using command line in DOS) in my java appication.
Do anyone know how to do this? Thanks a lot.This question has been asked upteen times.
ok the code is
for win95
Runtime.getRuntime().exec( "start c:\\tmp.txt" );
for win 2000
Runtime.getRuntime().exec( "cmd /C startc:\\tmp.txt" );
//change the file to your desire file..
i am not so sure about win98, sorry... -
How to run command line argument programe
Hi guys, I am doing pass command line argument programe in java but I don't know how to run this programe. Path for this programe in my my computer is C:\Users\Desktop\Mainjava\mycode\CommandProgjava*
{code/}
public class CommandProg
public static void main(String[] args)
System.out.println("d");
for (int i = 0; i < args.length; i++)
System.out.println(args);
{code/}
Where i need to go and what command i need to give so i can execute this programe(I am using window vista). I only know i have to give
this command some where CommandProg arg1 arg2 arg3 arg4. Output should be
Output:
arg1
arg2
arg3
arg4
Please help me, Thanks in advance.
Edited by: JayVirk on Dec 30, 2007 11:33 AMJay,
Your question isn't very clear, hence Joerg's well meaning but irrelevant advise.
Do you mean:
I've written a simple program in java which echos
it's command-line arguments to back to the console.
Here's my code:
package forums;
public class ArgsEchoer
public static void main(String[] args) {
for (String arg : args) {
System.out.println(arg);
But can't figure out how to compile and run the program.
I'm using winblows shista, and it's cr@p.
Please help me, Thanks in advance.So... where are you at? Have you installed the JDK (java development kit)? Which version? Is your path set? Is your classpath set?
Start here: http://java.sun.com/developer/onlineTraining/new2java/ -
How to run commands like "ipconfig" and get the output in adobe AIR in windows?
import flash.desktop.NativeProcess;
import flash.desktop.NativeProcessStartupInfo;
if (NativeProcess.isSupported) {
var npsi:NativeProcessStartupInfo = new NativeProcessStartupInfo();
var processpath:File = File.applicationDirectory.resolvePath("MyApplication.whatever");
var process:NativeProcess = new NativeProcess();
npsi.executable = processpath;
process.start(npsi);
The above can only run a sub-application, but how to run an independent application(command) like ipconfig and get the result?Hi,
here is an example of running a net Use command line from AIR, unig the new NativeProcess. Hope it will help !
function launchProcess()
var file = air.File.applicationDirectory;
// set command path
file = file.resolvePath("C:/Windows/system32/net.exe");
var nativeProcessStartupInfo = new air.NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = file;
// prepare command parameters
var args = new runtime.Vector["<String>"]();
args.push('USE');
args.push('W:');
args.push('/delete');
args.push('/y');
// set arguments
nativeProcessStartupInfo.arguments = args;
// add listeners to catch command outputs
process.addEventListener(air.ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
process.addEventListener(air.ProgressEvent.STANDARD_ERROR_DATA, onErrorData);
process.addEventListener(air.NativeProcessExitEvent.EXIT, onExit);
// create and run Native process
process = new air.NativeProcess();
process.start(nativeProcessStartupInfo);
function onOutputData(ProgressEvent)
var processResults = process.standardOutput.readUTFBytes(process.standardOutput.bytesAvailable);
air.trace("Results: \n" + processResults);
function onErrorData(ProgressEvent)
var processResults = process.standardError.readUTFBytes(process.standardError.bytesAvailable);
if(processResults.search('password') > -1){
window.alert('Bad password');
air.trace("Errors: \n" + processResults);
function onExit(NativeProcessExitEvent)
air.trace("Process ended with code: " + NativeProcessExitEvent.exitCode); -
[SOLVED] Problem with running GUI apps as root
Hi,
I have a serious problem with running any kind of software having GUI as root, which is indispensable for editing system files. For example I want to edit /etc/pacman.conf file with KWrite, and here's what I get
[zbyszek@barca ~]$ xhost +
access control disabled, clients can connect from any host
[root@barca zbyszek]# kwrite /etc/pacman.conf
kwrite(11282): Session bus not found
KCrash: Application 'kwrite' crashing...
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
sock_file=/root/.kde4/socket-barca/kdeinit4__0
Warning: connect() failed: : Nie ma takiego pliku ani katalogu
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi directly
drkonqi(11284): Session bus not found
Can anyone help me with this? Can anyone tell me how to login as root?
Thank you in advance.
Last edited by Zibi1981 (2010-10-05 19:30:20)O.K., but how to run KWrite as root on my account??? That was my main question
karol wrote:
Try running 'xhost +' as root.
https://bbs.archlinux.org/viewtopic.php?pid=817674
Maybe vim is in edit mode when you press 'i' but it doesn't show '-- INSERT --' at the bottom of the screen.
Here you are
[root@barca zbyszek]# xhost +
access control disabled, clients can connect from any host
[root@barca zbyszek]# kwrite /etc/pacman.conf
kwrite(12941): Session bus not found
KCrash: Application 'kwrite' crashing...
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
sock_file=/root/.kde4/socket-barca/kdeinit4__0
Warning: connect() failed: : Nie ma takiego pliku ani katalogu
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi directly
drkonqi(12942): Session bus not found
Last edited by Zibi1981 (2010-09-25 10:19:50) -
[solved] hook to run commands when user logs in? (before bash profile)
Is there any way to run commands when a user logs in but before the bash profile is sourced?
For example, I have a user account with a home directory on /tmp. When the user logs in, the home directory might not exist so there will be no .bash_profile to source. I want to run a script to create the directory if necessary and copy some files into it. How can that be done?
I thought of putting something in /etc/profile or /etc/profile.d/, but I would like to run something before the user's shell and environment become active.
I can use /etc/rc.local to do what I want, but I would prefer a hook to ensure that everything is set right when the user logs in.
Any ideas?
*edit*
Solution
In my case, I found that I could write my own shell script and set it as a login shell. In the script, I can configure everything I need before launching the interactive shell, then clean up anything after it exits.
Last edited by Xyne (2011-12-10 19:34:07)Thanks, dammannj. PAM could probably do what I need but I think I have found a simpler solution (see original post).
-
[SOLVED]how to run sdlmame?
I've been googling for like 2 years on how to run a mame game with no results. I've got the ninja gaiden rom, I've got sdlmame installed. How do I run it?
Last edited by actionM (2009-07-06 03:25:30)Oh my god, never mind. I can't believe I waited this long to ask, and then I figure it out while waiting. I looked at the mame.ini file and noticed the rom path, so I moved my rom to that path and typed sdlmame instead of sdlmame <game>.
-
SOLVED: php shell_exec() run command as root?
is there a way for me to execute a command as root from the php shell_exec() command? I am trying to create a simple web interface for my phone to preform simple server operations such as restart deamons.
in my php file im calling
$output = shell_exec('/path/to/my/script.py');
my script will do a /etc/rc.d/insert_daemon restart so it needs to be ran as root
I have tried to add
nobody=ALL :/path/to/my/script.py
to my sudoers file. i have also tried using
chmod 4755 script.py
chown root script.py
on the script. nothing seems to work for me.
I realize this is probably a security risk. anyone have any suggestions?
Last edited by murfMan (2010-04-11 17:09:48)solved it:
added
http ALL=NOPASSWD :/path/to/script.py
to sudoers
Last edited by murfMan (2010-04-11 17:13:43) -
How to run command on all machine in AD?
Hi,
I need to run few commands on different OU's in my Active directory environment, and want to make sure commands did run successfully on all machines. Please guide me for the same.Hello,
Either use a Start-Up script or use Enter-PSSession at Powershell or use
PSExec. Below links might be helpful. You need WinRM up and running on your clients.
Use PowerShell to Run WMI Commands on Remote Computers
PsExec v2.11
Regards.
Mahdi Tehrani |
|
www.mahditehrani.ir
Please click on Propose As Answer or
to mark this post as
and helpful for other people.
This posting is provided AS-IS with no warranties, and confers no rights.
How to query members of 'Local Administrators' group in all computers? -
How to run command line tool in my program???
Hi,all,I've got some tools that are usually,or take JDK for example,if we are not using an IDE,we need to open the command prompt,and then use the javac command to compile the source files and the "java "command to run the program,and both of them accept some command line params.The problem is that how could i integrate the tools in my own program,like JBuilder or some other IDE,you configure the params and compile and run in the IDE which don't need to open a command line prompt.Hope i have got my question clear:)
Best regards..jesperdj ,thanks:)
actually,i am using eclipse to run my ant tasks programmatically,but I got trouble with the AntRunner class.it seems that i should config a proper classloader for it,but i just don't know how.please lend a hand:)thanks
robin
Maybe you are looking for
-
I am looking to download Adobe Acrobat X Professional that I had purchased back in 2011
My computer has crashed and now I am trying to install Adobe Acrobat X Professional, but I can't find these drivers any where, not under my account either. Can you please help where I can find this?
-
Exp/Imp 10.2.0.1 Database
Can I export data from a database with 8k block size onto a target database with 16k block size?
-
Tech Preview for AJAX-enabled JSF with BEA Workshop 10.1
BEA is announcing a tech preview, ending in September 2007, for BEA Workshop Studio 10.1 and BEA Workshop for WebLogic 10.1. This technology preview integrates ICEFaces's Ajax-enabled JSF technology into Workshop. ICEfaces is a library of Ajax-enable
-
OBIEE HELP - Is there a way to get EVERYTHING to drill down?
Basically as per the title. I need my dashboard to allow me the power to click on every item and it drills/ filter by that item. For example - the columns I have are; Client ID, Surname, Forename, Gender, Ethnicity, Start, End, Days, Service Type (by
-
Error "no database selected" when importing tables from MySQL
I'm trying to import tables from MySQL to OBI repository. However, after selecting the MySQL ODBC and prompting user name and password there's an error: [nQSError: 16001] ODBC error state: HY000 code: 1046 message: [MySQL][ODBC 5.1 Driver][mysqld-5.0