[U2] sudo for dummies

2010-04-02 Thread John Rodgers
I have a problem with a developer login where we want to provide 'root' privileges on our DEV box. HP-UX B.11.11 U 9000/800 (tl) UniVerse 9.6 in Pick flavor This is done by changing the login profile to run something this: exec /usr/local.bin/sudo /usr/opt/uv/bin/uv This gives

Re: [U2] sudo for dummies

2010-04-02 Thread Scott Richardson
Have you tried the man pages of the OS and/or google for answers? Guess it somewhat depends on your actual sudo and operating system implementation, but I relatively quickly found the following link http://www.gratisoft.us/sudo/man/sudo.html Check the various options and their interactions

Re: [U2] sudo for dummies

2010-04-02 Thread Tom Whitmore
Can you explain what you are trying to do? you are creating a huge security hole with sudo because once the user is logged into UniVerse as root they can shell out, as root, and do whatever they would like to as root. If you want to have a user that can perform UniVerse admin role, check out

Re: [U2] sudo for dummies

2010-04-02 Thread Charles_Shaffer
Scott, I don't know about HP, but in Unix versions I have worked with, a user has to be in the system group or group 0 to be able to sudo. You might doublecheck your man pages for HP-UX and the user's setup. For one user this is not working but I cannot spot any difference in his setup from

Re: [U2] sudo for dummies

2010-04-02 Thread Drew William Henderson
John, I think this is an issue of how processes work in *nix, and how Universe looks at the account. Whether you execute sudo as a new process or replace the current process with the command you are executing (via exec), uv is running as root (you can do SH -c ps -ef | grep uv to see the

Re: [U2] sudo for dummies

2010-04-02 Thread John Rodgers
Thanks Charles I can man-handle the user through the login (in RAID) with this problem ID and everything works as expected. So the user is able to 'sudo'. The question is why the user.id changes for one user (to 'root') but not for others (which remain as their own login Id's). John Rodgers

[U2] UD: Phantoms

2010-04-02 Thread Bill Haskett
In UniData, does anyone know of a sure way to determine if a BASIC program is running as a phantom? We have a background service program in our application that has to be running as a phantom whenever UniData starts. The ability to start something when the dbms starts doesn't exist in

Re: [U2] UD: Phantoms

2010-04-02 Thread Martin Phillips
Hi Bill, In UniData, does anyone know of a sure way to determine if a BASIC program is running as a phantom? Take a look at the @USER.TYPE variable. This contains 1 for a phantom. Martin Phillips Ladybridge Systems Ltd 17b Coldstream Lane, Hardingstone, Northampton, NN4 6DB

Re: [U2] UD: Phantoms

2010-04-02 Thread Wally Terhune
Question wasn't clear to me. If looking at active processes, listuser shows which are phantoms (USRTYPE column) Also - UniBasic LISTUSER() function returns this as dynamic array for easy parsing :listuser Licensed(UDT+CP)/Effective Udt Sql iPhtm Pooled Total ( 32

Re: [U2] UD: Phantoms

2010-04-02 Thread Doug
Bill: Use the LOCK command with number 0 through 63. Have your phantom process do a LOCK 60. Then you can test it in other programs using the else clause: LOCK 60 THEN UNLOCK 60 * Restart phantom END ELSE * Phantom is running do nothing END -Original Message- From:

Re: [U2] UD: Phantoms

2010-04-02 Thread Bill Haskett
Martin: @USER.TYPE only tells me if the current process (the one I'm logged in on) is a phantom. It tells me nothing about other processes nor what programs are running on those other processes. I think... :-) Bill

Re: [U2] UD: Phantoms

2010-04-02 Thread Wally Terhune
For programs running on another process, use ECL PORT.STATUS command PORT.STATUS PID udt pid of target process CALL.STACK Wally Terhune U2 Support Architect Rocket Software 4700 S. Syracuse Street, Suite 400 **Denver, CO 80237 **USA Tel: +1.720.475.8055 Email: wterh...@rs.com Web:

Re: [U2] UD: Phantoms

2010-04-02 Thread Bill Haskett
Wally: Thanks. Using LISTUSER() I can figure out what processes are phantoms but not what they're running. Thus, I have no way to figure out of my BACKGROUND.SERVICE program is running (it sleeps and wakes up every minute). When I do a PORT.STATUS PID {pid# of phantom} CALL.STACK nothing

Re: [U2] UD: Phantoms

2010-04-02 Thread Martin Phillips
Hi Bill, Apologies. I had mis-understood the question. It looks like you have sufficient responses for me to back out of this discussion. Martin Phillips Ladybridge Systems Ltd 17b Coldstream Lane, Hardingstone, Northampton, NN4 6DB +44-(0)1604-709200 - Original Message - From:

Re: [U2] UD: Phantoms

2010-04-02 Thread Marc Rutherford
Bill, I have my Phantom processes update a status record (in the DICT of the file related to the Process) with the date/time as the start of each loop. Each program has a characteristic sleep time. The status record also serves as a run flag which can be set to '0' to stop the phantom. I

Re: [U2] UD: Phantoms

2010-04-02 Thread Bill Haskett
Doug: That is an idea. I was hoping I could be more direct, but this should work. Thanks, Bill Doug said the following on 4/2/2010 8:56 AM: Bill: Use the LOCK command with number 0 through 63. Have your phantom

Re: [U2] UD: Phantoms

2010-04-02 Thread Bill Haskett
Thanks Marc. I do the same. The problem is if the program crashes (or UD gets recycled in the development environment) the dict item isn't updated; thus I can't tell if the program is running or not (unless there are zero phantoms running). I think I can manage the phantom services with the

Re: [U2] UD: Phantoms

2010-04-02 Thread Beverly Wilson
Bill, We actually run this program to do what Marc suggests. Just formats the output a little nicer than the plain ps output. PROGRAM LIST.PHANTOMS STMT = '!sh -c ps -ef |grep PHANTOM |grep -v grep' EXECUTE STMT CAPTURING CAP NUM.LINES = DCOUNT(CAP,@AM) CRT CRT uid pid ? ?

Re: [U2] UD: Phantoms

2010-04-02 Thread Bill Haskett
Doug: After reading the documentation for LOCK... Resources are not automatically unlocked by the termination of the locking program. The UniBasic UNLOCK or ECL QUIT commands must release them. Otherwise, you can release resources by executing the ECL CLEAR.LOCKS command at UniData level.

Re: [U2] UD: Phantoms

2010-04-02 Thread BNeylon
Is there anyway to use the COMO file (_PH_)? If a Phantom ends or crashes the last line is something like PHANTOM process PID has completed. What happens when UDT is recycled? That has never happened to me. :-) Bruce M Neylon Health Care Management Group

Re: [U2] UD: Phantoms

2010-04-02 Thread Bill Haskett
Bruce: Thanks, but the _PH_ file is cleaned up every night using the CLEAR.ACCOUNT command (we use a number of 3rd party applications that create _PH_ items throughout the day). When I check out the locks I see it doesn't work as expected... 2 Dev (0)- LIST.LOCKS 2 Dev (0)- BPTEST LOCK 60

Re: [U2] UD: Phantoms

2010-04-02 Thread David Wolverton
I do a variation on this -- since my phantoms now need to be 'multi-account' (that is, 6 accounts, I need 6 phantoms - one per account) -- I do a READU of an 'item' from a 'Paramters' file -- the ItemID I attempt to read is AcctName-PHANRUN Don't care if it exists or not -- as long as the

Re: [U2] UD: Phantoms

2010-04-02 Thread Wally Terhune
Not sure. We do use signaling to 'interrupt' the running process and get it to tell the PORT.STATUS session what it is up to. IIRC, we use SIGUSR2, specifically. So - there could be some system calls that the udt process is in that cannot be interrupted. For instance, I tested a phantom that

Re: [U2] UD: Phantoms

2010-04-02 Thread Doug
Bill: On some sites we use 6 phantoms to do various activities. When the program crashes, which we can remember only once in 5 years, the LOCK was released. The other programs that need to phantom restarted it just as was shown in the code below. And those locks are released on restart. There

Re: [U2] UD: Phantoms

2010-04-02 Thread Bill Haskett
Thanks David. This could work. Bill David Wolverton said the following on 4/2/2010 10:57 AM: I do a variation on this -- since my phantoms now need to be 'multi-account' (that is, 6 accounts, I need 6 phantoms - one per

Re: [U2] UD: Phantoms

2010-04-02 Thread FFT2001
I second David's idea of using a READU also you can return exactly which port/pid has the lock set, which might be helpful as well if the phantom *shouldn't* be running! I'd go a set further and have the phantom actually timestamp when it set the READU lock.

Re: [U2] UD: Phantoms

2010-04-02 Thread Shaun.Ferguson
I am on digest, so apologies if this is a duplication of a suggestion made earlier. We tend to use plain old record locks for our phantom processes. The record won't list but if you try to edit it, it will come back as locked and prevents a second instance of the process from running. Ex; *

Re: [U2] UD: Phantoms

2010-04-02 Thread Bill Haskett
So, instead of sleeping for a minute (or close to it anyway) then loop 60 times and sleep for 1 second on each loop. I love it. :-) Thanks, Bill Wally Terhune said the following on 4/2/2010 11:05 AM: Not sure. We do

[U2] BDT is anyone using it?

2010-04-02 Thread Doug
Being a VAR for Rocket Software, we support BDT. We have this Universe customer that tells us about this new BDT release that got of the download site. Oops, we did not know there was a new release. This release does not match the one that we gave them. Anyways, they have this multilevel

Re: [U2] UD: Phantoms

2010-04-02 Thread Bill Haskett
I actually got this running. I used Wally's suggestion. I was already using a subroutine named IS.PHANTOM.RUNNING ( ServiceName, IsRunning). All I did was: 1) Run listusers() to get the list of users, 2) Parse out phantom users and run PORT.STATUS PID {n} CALL.STACK against them, 3)