HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Peculiar Custom LP Spooler Script Problem
Operating System - HP-UX
1838703
Members
3079
Online
110128
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2004 04:02 AM
04-23-2004 04:02 AM
Peculiar Custom LP Spooler Script Problem
A custom lp script performs the following functions:
if [ ! -d ${SOME_AREA}/${USER} ]
then
mkdir ${SOME_AREA}/${USER}
mkdir ${SOME_AREA}/${USER}/backup
chgrp -R groupX ${SOME_AREA}/${USER}
chmod 775 ${SOME_AREA}/${USER}
fi
Running as a spooled job (i.e the lp user), the script can create the dirs and chmod them but not change the group. If I run this script as lp from the shell, it can. I added some entries to log what was happening notably
echo "$?" >> ${SOME_AREA}/${USER}/errors
and
whoami >> ${SOME_AREA}/${USER}/errors
These show that it is execing as the "lp" user and that there and it returns 1 for the error. Of course, lp is a member of groupX but it is not its primary group. Any ideas ?
if [ ! -d ${SOME_AREA}/${USER} ]
then
mkdir ${SOME_AREA}/${USER}
mkdir ${SOME_AREA}/${USER}/backup
chgrp -R groupX ${SOME_AREA}/${USER}
chmod 775 ${SOME_AREA}/${USER}
fi
Running as a spooled job (i.e the lp user), the script can create the dirs and chmod them but not change the group. If I run this script as lp from the shell, it can. I added some entries to log what was happening notably
echo "$?" >> ${SOME_AREA}/${USER}/errors
and
whoami >> ${SOME_AREA}/${USER}/errors
These show that it is execing as the "lp" user and that there and it returns 1 for the error. Of course, lp is a member of groupX but it is not its primary group. Any ideas ?
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2004 04:16 AM
04-23-2004 04:16 AM
Re: Peculiar Custom LP Spooler Script Problem
After mkdir ${SOME_AREA}/${USER}/backup
do
newgrp "groupX" -- This make lp's primary group - groupx
chmod statement
newgrp "xx" (lp's original primary group)
Anil
do
newgrp "groupX" -- This make lp's primary group - groupx
chmod statement
newgrp "xx" (lp's original primary group)
Anil
There is no substitute to HARDWORK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2004 08:57 AM
04-23-2004 08:57 AM
Re: Peculiar Custom LP Spooler Script Problem
The newgrp command was a good idea but id did not work. Interestingly, I ran newgrp just before the end of the if-then tree followed by an "echo $? > /../errors" and the lp script ran up only to the newgrp command and bombed out not showing the error but the print job was deleted anyway. Below is a test script which works as explained previously except for chgrp groupX. This was added as a printer using 'lpshut; lpadmin -p nowork -i/tmp/nowork.sh -v/dev/null;lpsched'
#!/usr/bin/sh
JOBID=$1
USER=$2
TITLE=$3
COPIES=$4
OPTIONS=$5
OPT=$6
SOME_AREA=/tmp
if [ ! -d ${SOME_AREA}/${USER} ]
then
mkdir ${SOME_AREA}/${USER}
echo "Err $? #1" >> ${SOME_AREA}/${USER}/errors
mkdir ${SOME_AREA}/${USER}/backup
echo "Err $? #2" >> ${SOME_AREA}/${USER}/errors
chgrp -R ematrix ${SOME_AREA}/${USER}
echo "Err $? #3" >> ${SOME_AREA}/${USER}/errors
chmod 775 ${SOME_AREA}/${USER}
echo "Err $? #4" >> ${SOME_AREA}/${USER}/errors
whoami >> ${SOME_AREA}/${USER}/errors
# next 2 lines were rec. test
newgrp groupX
echo "Err $? #5" >> ${SOME_AREA}/${USER}/errors # never makes it to file
fi
exit 0
#!/usr/bin/sh
JOBID=$1
USER=$2
TITLE=$3
COPIES=$4
OPTIONS=$5
OPT=$6
SOME_AREA=/tmp
if [ ! -d ${SOME_AREA}/${USER} ]
then
mkdir ${SOME_AREA}/${USER}
echo "Err $? #1" >> ${SOME_AREA}/${USER}/errors
mkdir ${SOME_AREA}/${USER}/backup
echo "Err $? #2" >> ${SOME_AREA}/${USER}/errors
chgrp -R ematrix ${SOME_AREA}/${USER}
echo "Err $? #3" >> ${SOME_AREA}/${USER}/errors
chmod 775 ${SOME_AREA}/${USER}
echo "Err $? #4" >> ${SOME_AREA}/${USER}/errors
whoami >> ${SOME_AREA}/${USER}/errors
# next 2 lines were rec. test
newgrp groupX
echo "Err $? #5" >> ${SOME_AREA}/${USER}/errors # never makes it to file
fi
exit 0
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP