Visit Our UNIX and Linux User Community

Full Discussion: SU issues
Top Forums Shell Programming and Scripting SU issues Post 302139787 by yoi2hot4ya on Tuesday 9th of October 2007 07:53:21 AM
Old 10-09-2007
SU issues

Hi,
I have automated a build process that does the following activities.
1. check out code from cvs to a specific directory
2. build the revision checked out with 'ANT'
3. integrate the compiled code with the QA/UAT or new environment
(/apps/QA or /apps/UAT or /apps/new directory)

I have separated this into two scripts. The first one does steps 1 and 2 and then calls number 3. The reason that they are separated is that based on permissions steps 1 and 2 can be done only by and individual id while step 3 has to be done by the build user account that owns the integrated environments.

Here is the problem. I made the process interactive using 'select' contructs to allow the user to select different options. After steps 1 and 2 are completed I am executing and 'su' to switch to the build id to integrate the compiled code. However there are options in the second script also. For some reason when I 'su' the shell goes into an infinite loop when I prompt the user for feedback in the second script. It doesn't wait for response. I this the behavior of 'SU'? Is there any way around this? Thank you.

Here's how I su over in the script:
Code:
su - $vBuildUser <<-EOF
eval "$unixBuild -s $vSystem -r $vRevision -e $vIntegratedEnvironment"
wait
EOF
exit
exit

This User Gave Thanks to yoi2hot4ya For This Post:
 
Test Your Knowledge in Computers #672
Difficulty: Medium
The 802.11ad/ay, also known as WiGig operates in 60 GHz ISM band.
True or False?

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

scripting issues...

Hi guys, I am thanks in advance for any posts and for reading. I am trying to run this script, under solaris: echo "****************************************" echo "The host is: " echo "****************************************" <<EOF find /etc/default -name login -exec ls -l {} \; find... (5 Replies)
Discussion started by: B14speedfreak
5 Replies

2. Shell Programming and Scripting

while loop issues

Hi guys, Been sifting through these forums for awhile, but never had an account or needed to post. Shoutouts to a great forum with heaps of useful info. Now i consider myself a noob when it comes to linux and to bash scripting. I recently started to learn to use Vmware ESX server which uses... (4 Replies)
Discussion started by: ryath
4 Replies

3. HP-UX

swinstall issues

what the heck am I doing wrong? Im trying to install bastille and i keep getting errors. # cd - /var/spool/sw # ls B6849AA_B.02.01.03.depot catalog swagent.log var # swinstall -s /var/spool/sw B6849AA ======= 10/04/07 09:47:43 EDT BEGIN swinstall... (4 Replies)
Discussion started by: csaunders
4 Replies

4. Solaris

Issues with ldd

I tried to compile php and integrate it into apache on solaris. It compiled ok and I created a package. If I install it on a system that has the libpng from sunfreeware, it wants to use that library instead of the system SUNWpng. It doesn't run using SMCpng, but it runs using the system SUNWpng.... (4 Replies)
Discussion started by: Mike_the_Man
4 Replies

5. AIX

lpstat issues

Hi, I tried to migrate a server, I installed AIX on a new server and I want to configure the printer queues. I copied all of files from the old server where the printer queues are working fine. I followed these steps: 1. copy the /etc/qconfig (make a copy of the original before) 2. Copy the... (10 Replies)
Discussion started by: imad77
10 Replies

6. Shell Programming and Scripting

Issues with Expect

Here is a snippet of code that work for me: expect "abc" {send_log "abc found" } \ "def" {send_log "def found" } \ "123" {send_log "123 found} however the following does not and according to the book "Exploring Expect" it should be equivalent: expect { "abc"... (1 Reply)
Discussion started by: twk
1 Replies

7. Emergency UNIX and Linux Support

rm -rf issues

We are using the solaris server and if i am using rm -rf to delete the directories its asking the confirmation for each and every file inside the directory.Is there any way to disable ( should not ask the confirmation) only for a particular session? (12 Replies)
Discussion started by: sureshbabuc
12 Replies

8. Shell Programming and Scripting

Issues when dividing

Hi, I do have a very simple task to divide 2 variables and display the result. I CANNOT use bc when i try var1=2 var2=4 var3=$(($var1 / $var2)) echo $var3 the output is always 0 What can I change to get a dotted decimal result such as 0.5 ? Thanks! (5 Replies)
Discussion started by: svetoslav_sj
5 Replies

9. Shell Programming and Scripting

Function Issues

I am converting English letters/words/punctuation in leet speak. My current script works just fine, but when I call the functions it seem to be bypassing my second function altogether. I am new to shell scripting so excuse me if its an easy fix. Also, when using SED for whole word phrases like... (4 Replies)
Discussion started by: bri09
4 Replies
CVS-BUILDPACKAGE(1)                                           Debian GNU/Linux manual                                          CVS-BUILDPACKAGE(1)

NAME
cvs-buildpackage - build Debian packages from a CVS repository. SYNOPSIS
cvs-buildpackage [options] DESCRIPTION
This manual page explains the Debian cvs-buildpackage utility, which is used to build Debian packages whose sources are stored in a CVS repository. This is a CVS -aware wrapper around dpkg-buildpackage, and it first parses ./debian/changelog; exports the corresponding ver- sion (tagged debian_version_<$version> ), and runs dpkg-buildpackage in the exported tree. It looks for uncommitted files in the source tree, and offers to abort before doing anything so that the user may commit the files in, if they wish. cvs-buildpackage can also option- ally automatically re-tag all files before exporting the source (this functionality is only relevant in the top level directory of a checked out Debian package source tree, of course). Please note that the work directory referred to below is the scratch directory where the program does its work; it is where it shall export the sources from CVS, and it assumes full control of that directory Read: anything in that directory, apart from the orig source files, can be deleted by cvs-buildpackage Make sure not to have your checked out sources/working directory in the same location, as you may lose data. If this utility is not run from a top level directory of a checked out Debian package source tree, then to build an old version the cvs module name or the package name have to be supplied on the command line. Combined with the companion utilities cvs-inject and cvs-upgrade, this provides an infrastructure to facilitate the use of CVS by Debian maintainers. This allows one to keep separate CVS branches of a package for stable, unstable, and possibly experimental distributions, along with the other benefits of a version control system. OPTIONS
-h Print out a usage message. -M<module> The name of the CVS module. -P<package> Sets the name of the package. Very useful if this is not running in the CVS checked out source tree, in which case one also needs the version of the package, which may optionally be determined by checking out the latest debian/changelog file. -V<version> The version number of the package. In conjunction with setting the package name, this option allows operation outside a CVS source tree (just needs the repository). -T<tag> The CVS tag to use for exporting sources, rather than constructing one from the version. This assumes you know what you are doing. -U<tag> The CVS tag to use for the upstream tag, rather than constructing one from the upstream version. This assumes you know what you are doing. -C<Build Command> Sets the name of the builder program invoked, nominally set to dpkg-buildpackage. However, the user may choose to use a different build program, or a wrapper, or even 'chroot /opt/root dpkg-buildpackage' to build the package in a chroot jail, if desired. (Obvi- ously, this requires that the Work directory to be a subdirectory of a previously set up chroot jail). One may also hook in pbuilder by setting this variable to 'pdebuild --auto-debsign --buildresult ../'. (Again, this requires that pbuilder has been set up correctly). This argument overrides the settings in the environment variable CVSDEB_BUILDPACKAGE, and the configuration file variable conf_buildpackage. -G<get method> This option, if set, should contain a command to execute to get the original tarball into the current directory. This can then be used to allow one to get the original file using, for instance, wget or curl. This overrides the CVSDEB_GET_ORIG environment vari- able and the conf_get_orig configuration file option. -A Use apt-get source to retrive the original tarball. This option has no effect unless a source package with the correct upstream version has already been uploaded and is referenced from a Sources file known to apt. If -A and -G are both given, -G is tried first, and apt is used only if that did not produce the tarball. This overrides the CVSDEB_USE_APT environment variable and the conf_use_apt configuration file option. -R<root directory> Root of the original sources archive. We expect to find the <package name>_<version>.orig.tar.gz file under <root directory>/pack- age name>/ unless the cvs-buildpackage work directory has been set, or we want to export the original sources from the vendor branch of the CVS tree. If the cvs-buildpackage work directory is set anywhere, (command line, configuration file, environment variable), the root directory value is ignored, since we only need the root directory to set defaults for the cvs-buildpackage work directory. This argument overrides the settings in the environment variable CVSDEB_ROOTDIR, and the configuration file variable conf_rootdir. Please note that the cvs-buildpackage work directory referred to here is the scratch directory where this program works, not the directory that the human uses to work in. This should probably not be a sub dir of CVSROOT, since cvs shall refuse to export pack- ages there, and the script shall fail. -W<work directory> The full path name for the cvs-buildpackage working directory, into which the sources will be exported out of CVS and which should contain the original <package name>_<version>.orig.tar.gz Please note that it is not strictly essential to have the original sources, as this script will check out the vendor branch version tagged as upstream_version_<version> (without the Debian revision). However, these recreated original sources are likely to be different for consecutive runs of cvs-buildpackage, and very likely to be different from the pristine original sources (different enough to cause problems with an upload). Thus it is strongly advisable to keep the orig.tar.gz file around. Setting this variable overrides the settings for the root directory. This argument also overrides the settings in the environment variable CVSDEB_WORKDIR, and the configuration file variable conf_workdir. Please note that the cvs-buildpackage work directory referred to here is the scratch directory where this program works, not the directory that the human uses to work in. Also, you should specify an absolute path name for the work directory. This should probably not be a sub dir of CVSROOT, since cvs shall refuse to export packages there, and the script shall fail. -F The Force Tag option. This only has effect if run in the source directory. If set, it forces a cvs tag -F operation to be performed before exporting the sources. This argument overrides the settings in the environment variable CVSDEB_FORCETAG, and the configura- tion file variable conf_forcetag. The default action is not to force a tag before export. -E The Full Export option. Normally, cvs-buildpackage will export all the data from CVS using cvs export. If the orig.tar.gz is not available in the working directory, the full tree will be exported from CVS regardless of whether this option is set or not. This option overrides the environment variable CVSDEB_FULLEXPORT, and the configuration file variable conf_fullexport. -op The opposite of full export. Using this option resets the value of full export. Normally, cvs-buildpackage will export all the data from CVS using cvs export. With this option set, cvs-buildpackage will extract the orig.tar.gz in the cvs-buildpackage working directory, and then use the cvs rdiff command to bring that tree up-to-date with the CVS tree we're building. Please look at the -f<fix_script> option to see how to massage the source tree after extraction and patching. -ctp Include package_ at the start of the CVS tag. This overrides the CVSDEB_PACKAGEINTAG environment variable and the conf_forcetag configuration file option. The default is not to include the prefix. -n The no exec (or dry-run) option, causing cvs-buildpackage to print out all actions that would be taken without actually executing them. -f<fix_script> This option, if set, should point to a script that should be run just from the top level of the source tree to set up permissions of scripts that have been created by pathching the sources from an recently extracted original tar file (the behaviour attained by set- ting the -op option. This script is called with two arguments, the package name, and version. This script is only relevant when that option has been used. There a number of variables that are exported into the environment, for example package contains the name of the package, non_epoch_version contains the version of the package without the epoch, upstream_version contains the upstream ver- sion. debian_version contains the debian revision. cvstag contains the cvs tag, and cvs_upstream_tag contains the tag for the upstream version. -H<hook_script> This option, if set, should point to a script that should be run just before calling dpkg-buildpackage. Ideally, things like this are done using the modules file and programs, but is still provided here for convenience. This script is called with two arguments, the package name, and version. There a number of variables that are exported into the environment, for example package contains the name of the package, non_epoch_version contains the version of the package without the epoch, upstream_version contains the upstream version. debian_version contains the debian revision. cvstag contains the cvs tag, and cvs_upstream_tag contains the tag for the upstream version. This argument overrides the settings in the environment variable CVSDEB_HOOK which in turn over rides the config- uration file option conf_hook_script. -x<prefix> This option provides the CVS default module prefix (should really fix the CVS modules file). This argument overrides the settings in the environment variable CVSDEB_PREFIX. Note: The configuration file variable conf_prefix is not honoured by cvs-buildpackage, since the prefix is required to calculate the variables that are supposed to be defined when we load the config file (chicken and egg problem). The rest of the command line arguments are passed on, uninterpreted, to dpkg-buildpackage, though we do pay attention to the -r (root com- mand) option (which gives the command to achieve root access, usually sudo, fakeroot, or super ). The -r option overrides the other means of setting the root command, namely, the environment variable CVSDEB_ROOTCOMMAND, which in turn overrides the config file option conf_root- command. No attempt is made to check any other option. Please use the -h option to see which of the dpkg-buildpackage options are sup- ported and passed on. FILES
Apart from the runtime options, cvs-buildpackage also looks for site-wide defaults in the file /etc/cvsdeb.conf. After that, it looks for and reads ~/.cvsdeb.conf . The default configuration allows there to be a site wide override for the root or the cvs-buildpackage working directories on the site, but the cvsdeb.conf files are actually Bourne shell snippets, and any legal shell directives may be included in there. Note: Caution is urged with this file, since you can totally change the way that the script behaves by suitable editing this file. SEE ALSO
dpkg-buildpackage(1), cvs-inject(1), cvs-upgrade(1), cvsdeb.conf(5), cvs(1). AUTHOR
This manual page was written Manoj Srivastava <srivasta@debian.org>, for the Debian GNU/Linux system. Debian May 13 1999 CVS-BUILDPACKAGE(1)

Featured Tech Videos

All times are GMT -4. The time now is 12:36 AM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy