Operating System - HP-UX
1847253 Members
4183 Online
110263 Solutions
New Discussion

relocate print spooler location?

 
SOLVED
Go to solution
Annelise Wilken
Regular Advisor

relocate print spooler location?

I have a customer who is getting an increasing number of large printouts and as such /var the spooling area isn't big enough to handle this. He has no more free space left to allocate to /var (and won't buy additional disks). He wanted to know if the print spooler could be relocated elsewhere i.e he has a free disk that isn't associated with the root volume group, can I create a /var/spool on this other disk and link the "real" /var/spool to this new directory? Is it possible to relocate the spooling location?

Many thanks!
9 REPLIES 9
RAC_1
Honored Contributor

Re: relocate print spooler location?

As you know just do link to some other dir.

mkdir /path/spool1
copy all files from /var/spool to this dir.
lpshut
rm /var/spool
ln -s /path/spool1 /var/spool
lpsched -v

That's all.
There is no substitute to HARDWORK
AwadheshPandey
Honored Contributor

Re: relocate print spooler location?

copy files from /var/spool to some other dir which u want to create, link it to /var/spool.

Awadhesh
It's kind of fun to do the impossible
Joseph Loo
Honored Contributor

Re: relocate print spooler location?

hi,

as RAC has mentioned, u may change the softlink path but actually of /var/adm/lp/log to another path in a more unused file system:

# ls -ld /var/spool/lp/log
to check

another way is to check housekeep /var/tmp, /var/adm/syslog, etc and look out for any core files from /var file system.

regards.
what you do not see does not mean you should not believe
Annelise Wilken
Regular Advisor

Re: relocate print spooler location?

Not had chance to do this yet but will try later today - quick question though - shouldn't I just be linking /var/spool/lp as opposed to just /var/spool?

Thanks!
Bill Hassell
Honored Contributor

Re: relocate print spooler location?

It is very common for /var to fill up due to a single subsystem (email, spooling, logs, etc). Breaking up /var into separate mountpoints will prevent huge system-wide problems when /var fills up. Since the custeomer is unwilling to provide the right resources for system usage, you can indeed use a symlink to link /var/spool/lp/request (that's the directory with the actual print jobs) to another filesystem. Be sure to use lpshut before moving the contents to the new location, then create the link and verify that ll /var/spool/lp/request shows the same information after the link is created.

NOTE: symlinks useed to 'scatter' directories onto unrelated mountpoints can be a real sysadmin nightmare. I estimate that no one in your group or the customer will remember this symlink in 6 months and some backup/restore or Ignite action will create a problem because of the link.


Bill Hassell, sysadmin
Annelise Wilken
Regular Advisor

Re: relocate print spooler location?

This is what I propose to do:

1. Make a directory of the new location of the print spooler using disk09 (you specified this to be the new location):

mkdir /disk09/var/spool/lp

2. Stop the scheduler:

lpshut

3. Once the scheduler is stopped, copy all of the files from /var/spool/lp to the new directory:


cp â r /var/spool/lp/* /disk09/var/spool/lp

4. Move the original lp directory â this is in case we need to move it back:

mv /var/spool/lp /var/spool/ORIG.lp


5. Create a soft link to the new spooling directory:

ln â s /disk09/var/spool/lp /var/spool/lp

6. Check that the permissions on the new lp directory are the same as the original (permissions should be (755) drwxrwxr-x and the directory should be owned by lp group bin):

ls â l /disk09/var/spool

7. If permissions and ownership are incorrect change to that listed above:

chmod 755 lp
chown â R lp:bin lp


8. Restart the scheduler:

lpsched

9. If all works ok remove the directory moved in step 4:

rm â r /var/spool/ORIG.lp


Will this be ok or should I just do the above for /var/spool/lp/requests???????

Many thanks!
Rick Garland
Honored Contributor

Re: relocate print spooler location?

You could also make /var/spool on the other disk and make this its own filesystem.

Much in the same manner as making /var/crash it own filesystem. One advantage is that if /var/spool does fill, the /var will not be full.

You have separate filesystems for /var and /var/spool

Bill Hassell
Honored Contributor
Solution

Re: relocate print spooler location?

Several corrections for your procedure:

> mkdir /disk09/var/spool/lp

I would simplify this to just:
mkdir /disk09/varspool

No need to crteate the subdirectories since you only need the request directory stored on disk09.

> lpshut

Correct. Check that no proceses are running owned by lp:
ps -f -u lp

> cp -r /var/spool/lp/* /disk09/var/spool/lp

Since there are directories and files, I would use cpio -p to do everything:

cd /var/spool/lp/request
find . | cpio -pudlmv /disk09/varspool

That takes care of subdirectories and permissions, ownerships.

> mv /var/spool/lp /var/spool/ORIG.lp

Be sure most or all of the print queues are empty. Since we're doing just the request directory, the mv would look like this:

mv /var/spool/lp/request /var/spool/lp/request.ORIG

> ln -s /disk09/var/spool/lp /var/spool/lp

Since we're doing just the request directory, it would look like this:

ln -s /disk09/var/spool/lp/request /var/spool/lp/request

> 6. Check that the permissions on the new lp directory...

They will be fine. However, don't use the chmod -R or chmod -R commands. The -R option is very dangerous in that it does not distinguish between directories and files. Some directories and files are lp:lp, and others are lp:bin. Directories are all 755 but the files are 444 or perhaps 644.

The last step once everything is working correctly:

rm -rf /var/spool/lp/request.ORIG


Bill Hassell, sysadmin
Annelise Wilken
Regular Advisor

Re: relocate print spooler location?

I have been able to relocate the spooler as per previous posts - many thanks everyone!!