Sponsored Content
Full Discussion: su auto run help
Top Forums UNIX for Dummies Questions & Answers su auto run help Post 302136917 by sysgate on Thursday 20th of September 2007 11:12:27 AM
Old 09-20-2007
with TCL/expect - drawback - you need to store root pass in file. Example :
Code:
spawn su -
expect ?assword:
send "root-pass-here\r"

or else use sudo
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

auto run

Hi, There is a excutable program on Linux server and requires user to input some numbers to take them go through different steps to do things. I need to make the process from manual to automatic. I wrote a file that have each steps already typied. When user runs the program, I make them use below... (1 Reply)
Discussion started by: whatisthis
1 Replies

2. UNIX for Dummies Questions & Answers

Shell Script to Auto Run PHP Script

Hello All! I am looking to build a monitoring script. The script should always run as a system service of some type and should always check that a PHP script is running. Maybe there is a way to assign a PHP script to a certain PID so that the monitor script that check for the PID in top... (4 Replies)
Discussion started by: elDeuce
4 Replies

3. AIX

My script didn't run every run every minute at cronjob

In my cronjob, I would like to schedule my script.sh to run every minutes. I crontab -e and have in line below but it didn't seems to run at all. * * * * * script.sh When I run it manually, I can run it. Is that anything wrong with the above line? If I change it to something like below,... (4 Replies)
Discussion started by: ngaisteve1
4 Replies

4. Shell Programming and Scripting

Auto run script on USB device

Okay I want to write a script that I put on a jump drive. And when you plug the USB in this script executes. How would i go about doing this? I don't care what the program does right now. I just want to know how this would be done. Any ideas? (1 Reply)
Discussion started by: cbreiny
1 Replies

5. Shell Programming and Scripting

how to run an already made script run against a list of ip addresses solaris 8 question

how to run an already developed script run against a list of ip addresses solaris 8 question. the script goes away and check traffic information, for example check_GE-VLANStats-P3 1.1.1.1 and returns the results ok. how do I run this against an ip list? i.e a list of 30 ip addresses (26 Replies)
Discussion started by: llcooljatt
26 Replies

6. UNIX for Advanced & Expert Users

has no rc.local in /etc, how to auto run cmd in the boot process?

Hi I want to run some cmd before the linux boot up and I want to let it run before sshd service start, any helps? (1 Reply)
Discussion started by: yanglei_fage
1 Replies

7. Shell Programming and Scripting

Run a command for specific amount of time with an auto key press

Hi, I have been trying to do a small fun project for myself. I want to run a command for 45 seconds. And to get the final output of this command, the script requires I push the "q" key on my keyboard and then the final output file becomes available. I tried the following script. But it... (12 Replies)
Discussion started by: jacobs.smith
12 Replies

8. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies

9. UNIX for Beginners Questions & Answers

Howto auto boot SPARC | How to auto supply "start /SYS" and "start /SP/console" commands

When I power ON my T4-1, I got a prompt -> where I have to start /SYS and start /SP/console. How can I auto supply these two commands ? (3 Replies)
Discussion started by: z_haseeb
3 Replies
WIN32_CREATE_SERVICE(3) 						 1						   WIN32_CREATE_SERVICE(3)

win32_create_service - Creates a new service entry in the SCM database

SYNOPSIS
mixed win32_create_service (array $details, [string $machine]) DESCRIPTION
PARAMETERS
o $details - An array of service details: o $service - The short name of the service. This is the name that you will use to control the service using the net command. The ser- vice must be unique (no two services can share the same name), and, ideally, should avoid having spaces in the name. o $display -The display name of the service. This is the name that you will see in the Services Applet. o $description -The long description of the service. This is the description that you will see in the Services Applet. o $user - The name of the user account under which you want the service to run. If omitted, the service will run as the LocalSystem account. If the username is specified, you must also provide a password. o $password - The password that corresponds to the $user. o $path - The full path to the executable module that will be launched when the service is started. If omitted, the path to the current PHP process will be used. o $params - Command line parameters to pass to the service when it starts. If you want to run a PHP script as the service, then the first parameter should be the full path to the PHP script that you intend to run. If the script name or path contains spa- ces, then wrap the full path to the PHP script with ". o $load_order - Controls the load_order. This is not yet fully supported. o $svc_type - Sets the service type. If omitted, the default value is WIN32_SERVICE_WIN32_OWN_PROCESS. Don't change this unless you know what you're doing. o $start_type - Specifies how the service should be started. The default is WIN32_SERVICE_AUTO_START which means the service will be launched when the machine starts up. o $error_control - Informs the SCM what it should do when it detects a problem with the service. The default is WIN32_SERVER_ERROR_IGNORE. Changing this value is not yet fully supported. o $delayed_start - If $delayed_start is set to TRUE, then this will inform the SCM that this service should be started after other auto- start services are started plus a short delay. Any service can be marked as a delayed auto-start service; however, this setting has no effect unless the service's $start_type is WIN32_SERVICE_AUTO_START. This setting is only applicable on Windows Vista and Windows Server 2008 or greater. o $base_priority - To reduce the impact on processor utilisation, it may be necessary to set a base priority lower than normal. The $base_priority can be set to one of the constants define in Win32 Base Priority Classes. o $machine - The optional machine name on which you want to create a service. If omitted, it will use the local machine. RETURN VALUES
Returns WIN32_NO_ERROR on success, FALSE if there is a problem with the parameters or a Win32 Error Code on failure. EXAMPLES
Example #1 A win32_create_service(3) example Create a service with the short name 'dummyphp'. <?php $x = win32_create_service(array( 'service' => 'dummyphp', # the name of your service 'display' => 'sample dummy PHP service', # short description 'description' => 'This is a dummy Windows service created using PHP.', # long description 'params' => '"' . __FILE__ . '" run', # path to the script and parameters )); debug_zval_dump($x); ?> SEE ALSO
win32_delete_service(3), Win32 Base Priority Classes, Win32 Error Codes. PHP Documentation Group WIN32_CREATE_SERVICE(3)
All times are GMT -4. The time now is 04:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy