Join IIUG
 for   
 

Informix News
18 Nov 13 - ZDNet - Top 20 mobile skills in demand... Read
09 Sep 13 - telecompaper - Shaspa and Tatung have shown a new smart home platform at Ifa in Berlin. Powered by the IBM Informix software... Read
06 Sep 13 - IBM data magazine - Mission Accomplished - Miami, Florida will be the backdrop for the 2014 IIUG Informix Conference... Read
01 Feb 13 - IBM Data Magazine - Are your database backups safe? Lester Knutsen (IBM Champion) writes about database back up safety using "archecker"... Read
14 Nov 12 - IBM - IBM's Big Data For Smart Grid Goes Live In Texas... Read
3 Oct 12 - The Financial - IBM and TransWorks Collaborate to Help Louisiana-Pacific Corporation Achieve Supply Chain Efficiency... Read
28 Aug 12 - techCLOUD9 - Splunk kicks up a SaaS Storm... Read
10 Aug 12 - businessCLOUD9 - Is this the other half of Cloud monitoring?... Read
3 Aug 12 - IBM data management - Supercharging the data warehouse while keeping costs down IBM Informix Warehouse Accelerator (IWA) delivers superior performance for in-memory analytics processing... Read
2 Aug 12 - channelbiz - Oninit Group launches Pay Per Pulse cloud-based service... Read
28 May 12 - Bloor - David Norfolk on the recent Informix benchmark "pretty impressive results"... Read
23 May 12 - DBTA - Informix Genero: A Way to Modernize Informix 4GL Applications... Read
9 Apr 12 - Mastering Data Management - Upping the Informix Ante: Advanced Data Tools... Read
22 Mar 12 - developerWorks - Optimizing Informix database access... Read
14 Mar 12 - BernieSpang.com - International Informix User Group set to meet in San Diego... Read
1 Mar 12 - IBM Data Management - IIUG Heads West for 2012 - Get ready for sun and sand in San Diego... Read
1 Mar 12 - IBM Data Management - Running Informix on Solid-State Drives.Speed Up Database Access... Read
26 Feb 12 - BernieSpan.com - Better results, lower cost for a broad set of new IBM clients and partners... Read
24 Feb 12 - developerWorks - Informix Warehouse Accelerator: Continuous Acceleration during Data Refresh... Read
6 Feb 12 - PRLOG - Informix port delivers unlimited database scalability for popular SaaS application ... Read
2 Feb 12 - developerWorks - Loading data with the IBM Informix TimeSeries Plug-in for Data Studio... Read
1 Feb 12 - developerWorks - 100 Tech Tips, #47: Log-in to Fix Central... Read
13 Jan 12 - MC Press online - Informix Dynamic Server Entices New Users with Free Production Edition ... Read
11 Jan 12 - Computerworld - Ecologic Analytics and Landis+Gyr -- Suitors Decide to Tie the Knot... Read
9 Jan 12 - planetIDS.com - DNS impact on Informix / Impacto do DNS no Informix... Read
8 Sep 11 - TMCnet.com - IBM Offers Database Solution to Enable Smart Meter Data Capture... Read
1 Aug 11 - IBM Data Management Magazine - IIUG user view: Happy 10th anniversary to IBM and Informix... Read
8 Jul 11 - Database Trends and Applications - Managing Time Series Data with Informix... Read
31 May 11 - Smart Grid - The meter data management pitfall utilities are overlooking... Read
27 May 11 - IBM Data Management Magazine - IIUG user view: Big data, big time ( Series data, warehouse acceleration, and 4GLs )... Read
16 May 11 - Business Wire - HiT Software Announces DBMoto for Enterprise Integration, Adds Informix. Log-based Change Data Capture... Read
21 Mar 11 - Yahoo! Finance - IBM and Cable&Wireless Worldwide Announce UK Smart Energy Cloud... Read
14 Mar 11 - MarketWatch - Fuzzy Logix and IBM Unveil In-Database Analytics for IBM Informix... Read
11 Mar 11 - InvestorPlace - It's Time to Give IBM Props: How many tech stocks are up 53% since the dot-com boom?... Read
9 Mar 11 - DBTA - Database Administration and the Goal of Diminishing Downtime... Read
2 Feb 11 - DBTAs - Informix 11.7 Flexible Grid Provides a Different Way of Looking at Database Servers... Read
27 Jan 11 - exactsolutions - Exact to Add Informix Support to Database Replay, SQL Monitoring Solutions... Read
25 Jan 11 - PR Newswire - Bank of China in the UK Works With IBM to Become a Smarter, Greener Bank... Read
12 Oct 10 - Database Trends and Applications - Informix 11.7: The Beginning of the Next Decade of IBM Informix... Read
20 Sep 10 - planetIDS.com - ITG analyst paper: Cost/Benefit case for IBM Informix as compared to Microsoft SQL Server... Read
20 Jul 10 - IBM Announcements - IBM Informix Choice Edition V11.50 helps deploy low-cost scalable and reliable solutions for Apple Macintosh and Microsoft Windows... Read
20 Jul 10 - IBM Announcements - Software withdrawal: Elite Support for Informix Ultimate-C Edition... Read
24 May 10 - eWeek Europe - IBM Supplies Database Tech For EU Smart Grid... Read
23 May 10 - SiliconIndia - IBM's smart metering system allows wise use of energy... Read
21 May 10 - CNET - IBM to help people monitor energy use... Read
20 May 10 - ebiz - IBM Teams With Hildebrand To Bring Smart Metering To Homes Across Britain... Read
19 May 10 - The New Blog Times - Misurare il consumo energetico: DEHEMS è pronto... Read
19 May 10 - ZDNet - IBM software in your home? Pact enables five-city smart meter pilot in Europe... Read
17 March 10 - ZDNet (blog) David Morgenstern - TCO: New research finds Macs in the enterprise easier, cheaper to manage than... Read
17 March 2010 - Virtualization Review - ...key components of Big Blue's platform to the commercial cloud such as its WebSphere suite of application ser vers and its DB2 and Informix databases... Read
10 February 2010 - The Wall Street Journal - International Business Machines is expanding an initiative to win over students and professors on its products. How do they lure the college crowd?... Read


End of Support Dates

IIUG on Facebook IIUG on Twitter

[ View Thread ] [ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

IDS Forum

RE: RE: I have a puzzling situation

Posted By: John Adamski
Date: Monday, 5 November 2012, at 1:39 p.m.

Jim,

Here is the code (sql) using in my test procedure:

drop procedure testsysfail;

create procedure testsysfail()
returning char(32);

on exception in (-668)

return "Failed, error 668";
end exception;

SYSTEM " /tmp/test.csh";

return "succeded";
end procedure;

grant execute on testsysfail to public;

It is based on the production procedure, I just kept the few lines I needed that I thought to get a good equivalent procedure. As you can see the SYSTEM line only has SYSTEM " /tmp/test.csh"

And this is the content of the test.csh script:

#!/bin/csh -f
##
printenv | sort >& /tmp/test.log

id -rg >>& /tmp/test.log

id -ru >>& /tmp/test.log

exit 0

I reran the procedure as both users and get the same results one works one doesn't.

I than changed the SYSTEM command to be like your suggestion below " /usr/bin/csh -f -v -x -c /tmp/test.sh >& /tmp/test.log ". I get the 668 error on the user that normally works. I also changed the SYSTEM command to go to test2.log, still get the 668 error. Then I did a which csh and changed the SYSTEM command to use /bin.csh and same results.

If I'm understanding your logic, running csh in the SYSTEM should have forced a sub-shel - well that doesn't seem to working. Which might imply one user is getting a sub-shell and the other not. But I can't find any setup that is different between the two users.

john

-----Original Message-----
From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of jim-cramer@uiowa.edu
Sent: Friday, November 02, 2012 12:47 PM
To: ids@iiug.org
Subject: RE: RE: I have a puzzling situation [28698]

Hi John,

What might be most helpful for us would be if you could post the exact string, containing whatever is to be run by the shell, which is specified with SYSTEM in the proc.

fyi:

1) in case any more questions about the environment for the command run by SYSTEM come up , I am including below what my test.sh script dumped out. However, I am on Linux SLES and you are on HPUX so perhaps the Linux OS does things differently when the use of SPL SYSTEM causes the OS system() function to fork off a shell for running the command specified with SYSTEM in. But I still thought that I would send it in case it helps as a reference to what you see in your test Environment. Also, it raises a couple of questions, And I have a suggestion too.

NOTE 1 strange thing in the output, the Env Var near the end of the Env dump is:

SHLVL=1

which means that a *login* shell (shell level 1) is being created by the OS to run the command in, which means that not only personal user dot files but system-wide scripts, depending upon the shell which ones, will run. This makes the questions about the shell's Env more complex.

2) Also, I thought that person earlier posted that the command executed in the shell due to the use of SYSTEM in a SP is executed in a *sub*-shell. Perhaps that is true on OS platforms for IDS and not true on others. I did not see the SHLVL Env Var in the Environment listing for your sucessful tests. I guess that you would have to consult man pages for either the HPUX or the particular shell, csh, used in the tests.

3) I seem to remember that you were redirecting standard error to the test's log file. You did that for each of the 3 commands in test.sh, right?.

You could try this as the argument to SYSTEM to be run by the SP

" /usr/bin/csh -f -v -x -c /tmp/test.sh >& /tmp/test.log "

It will start a subshell for the test.sh script, not source in .cshrc and any other dot files, and echo to the log file every command before it executes so that you can see if test.sh even run and, if so, where it dies.

The redirection of stdin and stdout on the command line SYSTEM specifies might dump something useful to stderr if it cannot even run the csh subshell.

4) ALSO, check the ~/.history file in the HD of the username that ran the Proc.
This might tell you what ran and did not run, or if nothing ran at all.

5) Finally, I discovered that one of the "id" commands I gave you was wrong.

"id -r" should have been "id -ru"

That command will get the userid of the user under whose id the shell or subshell was created. See if it is the id of the user runing the proc, or else that of informix or root.

"id -u"

was correct and would give you the "effective" id, which would be different than the "real" if a different userid started up the shell under it's id but made the call to change the "effective" id to that of the user who ran the proc.

In my platform and environment, the real id was mine, who ran the test. If that is the case then the "effective" id should be the same and no SETUID business is going on.
That is why both ids immediately below for me are my user id, 13008.

I would be interested in what the 2 ids turn out to be and who they belong to on your system if you happen to run the test.sh script again.

Regards,
Jim

13008
13008
CLIENT_LOCALE=en_us.8859-1
DBCENTURY=C
DBPATH=//ids_np
DBTEMP=/tmp
DB_LOCALE=en_us.8859-1
INFORMIXDIR=/opt/db/ids
INFORMIXSERVER=ids
INFORMIXSQLHOSTS=/opt/db/etc/sqlhosts
LANG=POSIX
LC_COLLATE=POSIX
LC_CTYPE=en_US.UTF-8
LC_MONETARY=POSIX
LC_NUMERIC=POSIX
LC_TIME=POSIX
ONCONFIG=onconfig
PATH=/opt/bdl3.5r16b/bin:/opt/db/informix/fg_vdt3/bin:/opt/db/informix/fg_vd
t3/bin:/opt/bdl3.5r16b/bin:/opt/db/bin:/opt/db/informix/4gltools7.3/bin:/opt
/bdl3.5r16b/bin:/opt/db/informix/fg_vdt3/bin:/opt/db/informix/fg_vdt3/bin:/o
pt/bdl3.5r16b/bin:/opt/db/bin:/opt/db/informix/4gltools7.3/bin:/opt/bdl3.5r1
6b/bin:/opt/db/informix/fg_vdt3/bin:/opt/db/informix/fg_vdt3/bin:/opt/bdl3.5
r16b/bin:/opt/db/bin:/opt/db/informix/4gltools7.3/bin:/user/eng/jcramer/bin:
/usr/local/bin:/usr/bin:/opt/ansic/bin:/usr/ccs/bin:/usr/contrib/bin:/usr/co
ntrib/Q4/bin:/opt/perl/bin:/opt/ipf/bin:/opt/mpi/bin:/opt/hparray/bin:/opt/n
ettladm/bin:/opt/fcms/bin:/opt/mozilla:/opt/netscape:/usr/local/bin:/opt/sec
_mgmt/bastille/bin:/opt/resmon/bin:/opt/gnome/bin:/opt/graphics//phigs/bin:/
usr/bin/X11:/usr/sbin/diag/contrib:/usr/contrib/kwdb/bin:/opt/wbem/bin:/opt/
wbem/sbin:/opt/graphics/common/bin:/opt/sec_mgmt/spc/bin:/opt/mx/bin:/opt/hp
smh/bin:/opt/upgrade/bin:/opt/gwlm/bin:/usr/contrib/bin/X11:/opt/aCC/bin:/op
t/fortran90/bin:/opt/fortran90/contrib/bin:/opt/perf/bin:/opt/STK/bin:/opt/l
angtools/bin:/opt/imake/bin:/usr/ui/class/com
PDQPRIORITY=0
PWD=/home/jcramer
SERVER_LOCALE=en_us.8859-1
SHELL=/usr/bin/bash
SHLVL=1
SQLPID=1470959656
TZ=CST6CDT
_=/usr/bin/env:

-----Original Message-----
From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of JASON HARRIS
Sent: Thursday, November 01, 2012 11:34 PM
To: ids@iiug.org
Subject: Re: RE: I have a puzzling situation [28695]

Hi John,

The first id statement in your test.csh might have an error in it, so even when you execute the script correctly, you still get a non-zero exit status.

Fix it, i.e. id -ru or id -rg depending on what you want, or explicitly put an exit 0 at the end of the script.

It is also good practice to output stderr to the log as well as stdout. This

will capture any errors from the commands in the script. e.g. >&test.log instead of just >test.log. This would show you the error with the id statement.

You sure have checked a lot of different things. Here a couple more to keep you going.

Change your exception handling to set a value containing the actual SQL and ISAM error codes, and include them in your returned string.

Check you can successfully execute the script when logged in as each user, without using the stored procedure.

Check for the existence of a .informix file in the users home directory, it is another way to get settings into a session.

Make sure you are creating the stored procedure as the user Informix.

Otherwise, contact tech support cause it might be a bug.

HTH,

Jason

****************************************************************************
***
Forum Note: Use "Reply" to post a response in the discussion forum.

*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.

Messages In This Thread

[ View Thread ] [ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

IDS Forum is maintained by Administrator with WebBBS 5.12.