the Startup script file????


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users the Startup script file????
# 1  
Old 03-03-2005
the Startup script file????

hi guys,
just went thru a "how to" manual on Solaris CDE....
could any of you pleaz tell me how to restrict users from logging in at
particular times....
in linux,i wrote an access script, put in in /etc/profile and was able t o
restrict users from logging in at particular times on particular days... .{
didnt use PAM }
but its not working in Solaris....
the X session gets killed but still the user is thrown at the shell
prompt..as in fail safe mode....
any ideas how to go about this???

the prob is:-
there are "N" no. of users and every one has a particular fixed time slo t
given on a particular fixed day,,,to access the services....
users shouldnt be able to log in in their unscheduled times.....
also i should be able to keeptrack of the time user is logged in...so as
to display a warning message before his/her slot gets over on that
day.....my script is working fine in linux...from shell prompt as well as
X-prompt.....but..its not working in solaris...???
infact i am not able to figure out where cud i call this script
from....and why doesnt the user log off { 'have tried Kill -9 -1 ,
exit , logout etc } instead of being thrown at
the prompt................

hope you ppl could help me out.....
Regards
Swordfish
p.s. how can one display messages on X-window????..i mean user shouldn,t
just be denied acces..without telling him/her the reason???
I posted the same thread in another forum...my apologies
# 2  
Old 03-04-2005
Maybe you could try this... have the script that validates the user return an exit code depending on whether the user should have access or not; 0 for access and 1 for no access (maybe.. you can decide your return codes) and in each users .profile, write exit on receiving a 1 from the validation script.

I know that this may be a lot of work if you have a lotta users, but this is just off the top of my head Smilie
# 3  
Old 03-05-2005
thats ok...
but my point is not only this exiting stuff.............
what i am not sure about is the following:-

1) where to put the validation script in Solaris ..i.e what is the equivalent for /etc/profile in solaris

2) why r the two unix systems behaving differently for kill -9 -1 and exit ?????
{ linux nd solaris }

swordfish
# 4  
Old 03-10-2005
... solaris does use /etc/profile (as does other *nixes) ... why kill behaves differently in linux compared to solaris is most likely because of how each os handles signals to processes ...

if your validation script doesn't work from /etc/profile ... you can also have a sleeping daemon script that checks for users and validates their access hours against a table and then sends pop-ups to users based on your requirements and/or terminates their session ...

if you set the display to the user's desktop ... you can have an xterm window pop-up and warn the user about his or her access through "xterm -e" (see man xterm)
# 5  
Old 03-11-2005
hey,
ya it does have /etc/profile....
but my users by default have Csh as default shell and not bash....
my default shell is /bin/sh
so scripts in /etc/profile wont work because its not sourced....
the first file that gets sourced is /usr/dt/bin/Xsession for logins through common desktop environment [ CDE ] Solaris............
and my problem is...any script call from here doesnt work...
eg i added this line in it

if [ $LOGNAME -ne root ]
then
/etc/access.sh
fi

but it just isnt working ..............

and ya ..regarding daemon script.......how is it gonna be different from a normal script...and how m i gonna start it at the first place.... i mean from where should i source it.
# 6  
Old 03-11-2005
a daemon script is really no different than a normal script except for how it "functions" ... in this case, "nothing" calls it, it starts "by itself," and it does it's work in the background ... you can start it from cron or from a startup script in /etc/rc3.d (check other scripts there for formatting) so it starts up after every reboot ...
# 7  
Old 03-21-2005
Startup Script file

there is file called .dtprofile in every users who has authority to use Xsession in the CDE environment for *nixes.


Within this file there is a line called

# DTSOURCEPROFILE=true

uncomment this line will enable the usage of the .profile of the particular user.
This will in turn make either your .profile or .cshrc available and you can code the validation of the users restrictions in the startup scripts.

Hope this helps.
Smilie

Jerardfjay
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Startup script

I can't quite find a clear answer on how to properly write a start up script. Does anybody have any ideas?? (3 Replies)
Discussion started by: Huitzilopochtli
3 Replies

2. Shell Programming and Scripting

Apache tomcat startup script not booting at startup.

I copied the script from an AskUbuntu post - #!/bin/bash ### BEGIN INIT INFO # Provides: tomcat7 # Required-Start: $network # Required-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start/Stop Tomcat server ### END INIT INFO ... (14 Replies)
Discussion started by: Hijanoqu
14 Replies

3. UNIX for Dummies Questions & Answers

Startup IE via shell script

in my windows, i installed MKS Toolkits so i can use vi and ksh. i can start internet explore from cmd C:\program files\internet explore\iexplore.exe fine, but when it wont start within my shell script: !#/bin/ksh cd /program files/internet explore iexplore.exe i know this is unix, not... (4 Replies)
Discussion started by: lawsongeek
4 Replies

4. AIX

startup script

Hi I need the below script to be started whenever I reboot my aix server ? #cat cdbegin /cdirect/cdunix/ndm/bin/cdpmgr -i /cdirect/cdunix/ndm/cfg/cbspsdb01/initparm.cfg Please suggest how to add this to the startup ? (2 Replies)
Discussion started by: samsungsamsung
2 Replies

5. UNIX for Dummies Questions & Answers

run a script at startup

hi, i am using rhel 5, and i wanna run a script as soon as the operating system open. How can i do this ? ( i was reading rc.d files but i could not understand exactly what are the run levels and where should i put the my shell script. my script will be : #!/bin/ksh iptables -I INPUT... (1 Reply)
Discussion started by: futi
1 Replies

6. UNIX for Dummies Questions & Answers

Startup Script Somewhere ?

Hello there! I need help. Everytime I login to my ssh, i see this: -bash: .export: command not found -bash: .export: command not found -bash: .export: command not found -bash: .export: command not found any help ? thanks (0 Replies)
Discussion started by: fbauto1
0 Replies

7. Shell Programming and Scripting

Need to run script at startup.

Hi guys , I Need to run a specific command (pinging a particular machine). Which need to run every time i reboot the server till the time it shut down. What is the preferred way of doing this. Will it impact my system performance. My Operating system is as below. # lsb_release -a... (3 Replies)
Discussion started by: pinga123
3 Replies

8. Shell Programming and Scripting

how to take input at the startup script!!

Hi all, I am trying to modify a startup script... The problem is that i am unable to figure out how to take inputs from the user at the startup screen and proceed with the processing accordingly... Eg: $ echo "this is a test" (typically this would produce the output)... $ echo "this is a... (6 Replies)
Discussion started by: wrapster
6 Replies

9. Shell Programming and Scripting

Startup script

New in Unix, I am adding a line "route add 57.14.y.y 57.14.x.x" every day after rebooting the system. Where can I add the line so during boot up (the system is re-started every day by design (???) the line is executed? (I tried the /etc/rc2.d/S90 but for some reason the line needs to be added... (2 Replies)
Discussion started by: texaspanama
2 Replies
Login or Register to Ask a Question