Sponsored Content
Full Discussion: Start a service as user
Top Forums Shell Programming and Scripting Start a service as user Post 302186017 by potro on Wednesday 16th of April 2008 09:36:45 AM
Old 04-16-2008
Start a service as user

Hi
I need a service to be start as user after a reboot. My script in /etc/init.d contain the following:

start()
{
su - $USER
cd ${INSTALL_PATH}/bin
./MyApp -X
exit
return 0
}

This function stops after su - $USER, I get user shell, and only if I manualy exit it continues with the next commands cd .... and MyApp starts as root instead of user.

Thanks,
Bianca
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Making a Script to Start as a Service

Hi, I have a shell script t1.sh. on my solaris box. So, what are the steps required to make this script run as a Service, when the system re-starts. (for ex:- at run level 3). I know that I should use the rc.d folders. But I don't know the exact steps. Kindly explain, Thanks in... (3 Replies)
Discussion started by: S.Vishwanath
3 Replies

2. Programming

MySQL service start error

Hi, I have installed MySql version 5.0.67 in RedHat LINUX version 5. The installation completed successfully. When I am trying to start the service an error occured the error shown below ".......Manager of pid-file quit without updating file" Can anyone help me to fix the problem.... (4 Replies)
Discussion started by: saravanakumar
4 Replies

3. Solaris

StartUP file to start a service

Hi guys: i have a Solaris 10 development server and a Solaris 9 production server. The entire task must be done in the dev. server. When it's done and all the testing is OK, the script or files are transfer to prod. Server. All right. Now I have to figure out a way to put a script to initiate... (2 Replies)
Discussion started by: bmathiasf
2 Replies

4. AIX

Q: how to start a service when system start

As topic, assume we have a service called "blahservice" and we can start it by: startsrc -s blahservice what is the best practice to run such command when system start? - directly use mkitab to add it into /etc/inittab or - drop startup scripts in /etc/rc.d/rcX.d I know they... (4 Replies)
Discussion started by: acerlinux
4 Replies

5. Red Hat

VSFTPD Service Failed to Start

Today I have installed VSFTPD but service is failing to start. We have been using standard FTP successful but need to introduce an FTPS option. I have run YUM install VSFTPD and everything appeared to load ok. (If I run rpm - qa | grep vsftpd I get vsftpd-2.0.5-16.el5_4.1 which I... (4 Replies)
Discussion started by: PaulComins
4 Replies

6. Red Hat

Can't start NTOP service/daemon

I have installed version of ntop 4.0.3 by guide. But I can't start ntop daemon/service. I didn't find a service file for starting. During the installation there was no problem only want to RRDTool so I installed that. Now there is no necessary package required. I didn't find in /etc/init.d/... (9 Replies)
Discussion started by: getrue
9 Replies

7. Ubuntu

start service when get login prompt

Hi Team, I am using DRBL environment on Ubuntu. When my machine starts some times it's not starting lxdm & nslcd service. Because of that i didn't get graphic mode & also not able to authenticate user as nslcd is also stops. I have to login as root and restart these two services, then i am able... (0 Replies)
Discussion started by: paragnehete
0 Replies

8. Shell Programming and Scripting

not able to start xvfb service via rc script

Hi , I am having this start script to start xvfb under rc3.d but it fails during system startup saying unable to open display. also manually if i try to execute the script , it does not work. But if i execute what ever is there in the script line by line on my SHELL , it starts well. ... (2 Replies)
Discussion started by: chidori
2 Replies

9. Solaris

How to make SMF service start last?

I need to start a service among the last on a freshly booted system. Via the manifest, I've made it dependent on very milestone on the computer yet the service still comes back with an error that a kstat variable in the kernel does not exist. I run it right the service process right there... (6 Replies)
Discussion started by: JWH
6 Replies

10. Solaris

Not able to start cron service in Solaris 10

Hi, This is Solaris-10 x86. I am not able to start cron service, configured in FMRI. It is in maintenance and when I clear it, it seems like calling and failing on /etc/init.d/tcs-rtm script. I am not able to figure out, why cron is calling that script, if this failure is because of that. Cron... (5 Replies)
Discussion started by: ron323232
5 Replies
Catalyst::Engine::Apache2::MP20(3pm)			User Contributed Perl Documentation		      Catalyst::Engine::Apache2::MP20(3pm)

NAME
Catalyst::Engine::Apache2::MP20 - Catalyst Apache2 mod_perl 2.x Engine SYNOPSIS
# Set up your Catalyst app as a mod_perl 2.x application in httpd.conf PerlSwitches -I/var/www/MyApp/lib # Preload your entire application PerlModule MyApp <VirtualHost *> ServerName myapp.hostname.com DocumentRoot /var/www/MyApp/root <Location /> SetHandler modperl PerlResponseHandler MyApp </Location> # you can also run your app in any non-root location <Location /some/other/path> SetHandler perl-script PerlResponseHandler MyApp </Location> # Make sure to let Apache handle your static files # (It is not necessary to remove the Static::Simple plugin # in production; Apache will bypass Static::Simple if # configured in this way) <Location /static> SetHandler default-handler </Location> # If not running at a root location in a VirtualHost, # you'll probably need to set an Alias to the location # of your static files, and allow access to this location: Alias /myapp/static /filesystem/path/to/MyApp/root/static <Directory /filesystem/path/to/MyApp/root/static> allow from all </Directory> <Location /myapp/static> SetHandler default-handler </Location> </VirtualHost> DESCRIPTION
This is the Catalyst engine specialized for Apache2 mod_perl version 2.x. ModPerl::Registry While this method is not recommended, you can also run your Catalyst application via a ModPerl::Registry script. httpd.conf: PerlModule ModPerl::Registry Alias / /var/www/MyApp/script/myapp_registry.pl/ <Directory /var/www/MyApp/script> Options +ExecCGI </Directory> <Location /> SetHandler perl-script PerlResponseHandler ModPerl::Registry </Location> script/myapp_registry.pl (you will need to create this): #!/usr/bin/perl use strict; use warnings; use MyApp; MyApp->handle_request( Apache2::RequestUtil->request ); METHODS
ok_constant OVERLOADED METHODS
This class overloads some methods from "Catalyst::Engine". unescape_uri OVERLOADED METHODS
This class overloads some methods from "Catalyst::Engine". unescape_uri SEE ALSO
Catalyst, Catalyst::Engine, Catalyst::Engine::Apache2. AUTHORS
o Sebastian Riedel <sri@cpan.org> o Christian Hansen <ch@ngmedia.com> o Andy Grundman <andy@hybridized.org> o Tomas Doran <bobtfish@bobtfish.net> COPYRIGHT AND LICENSE
This software is copyright (c) 2010 by The "AUTHORS". This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.10.1 2010-11-26 Catalyst::Engine::Apache2::MP20(3pm)
All times are GMT -4. The time now is 01:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy