BookmarkSubscribeRSS Feed
PhilMason
Obsidian | Level 7
When I run a stored process I can issue system commands (since I turned the option on to allow me to do so). These commands run as sassrv - which is the userid that runs our stored processes. I would like to do an SU command to become another user (sas) since I am trying to make a stored process to restart our spawners. However the SU command prompts for a password, and I cant reply to that prompt in my stored process ... or can I?

Please advise.

thanks
Phil
4 REPLIES 4
LinusH
Tourmaline | Level 20
Isn't it possible to call a script that in turn does the su command (and calls the restart spawner script)?

/Linus
Data never sleeps
PhilMason
Obsidian | Level 7
thanks for the idea Linus, but dont I have the same problem? In a script I would do say ...

su sas

and then the script would prompt for the password. I looked at the man page for su and couldnt see any way to pass the password into the su command. It would be nice if I could do ...

su sas / pwd=abc

but I cant (as far as I know)...
LinusH
Tourmaline | Level 20
After a little stroll around the net, I found that this seems to be a generic problems. Some of the suggested solutions are:

-running as root (not recommended)
-using printf together with telnet
-using something called sudo (seperate package)
-using somthing called expect package

/Linus
Data never sleeps
mgst170
SAS Employee
Just thinking out loud..... but how do you use a Stored Process to restart the Object spawner? The minute you issue the restart command to the spawner, it will kill your stored process, and you will never get any results back to check whether your command was successful. Or are you intending to kill the actual PID's that relate to the Stored Process Server but leave the spawner running?

For what it's worth, if you have SAS connect, you could in theory have an STP that calls a signon to your server but uses the SAS User credentials. Once that connect session is established, you could then execute the call to the object spawner to restart it as you will be now running under the SAS user account.

When I have done this in the past, it has typically been through the use of another 3rd party tool - sudo, upm etc.

Cheers.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1329 views
  • 0 likes
  • 3 in conversation