WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Cups Print Server  (Read 21879 times)

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Cups Print Server
« on: March 14, 2011, 04:52:53 AM »
Hi all,

I found tinycore linux while googling a linux os that works well on an old Pentium 2.

I've booted the machine up with a stock standard current release of tinycore linux cd and it worked fine.

I see that tinycore linux is meant to be a boot clean os, is it possable to setup cups to serve a printer to a windows network, and have all settings for the print server and cups loaded in case a reboot occurs ?
Live long and prosper.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Cups Print Server
« Reply #1 on: March 14, 2011, 08:12:15 AM »
Search the forum for CUPS. You will find many threads.

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: Cups Print Server
« Reply #2 on: March 14, 2011, 09:55:42 PM »
Hi all,

Heres what i've done.

Installed tinycore to hard drive. following > http://tinycorelinux.com/install.html

I've installed cups using the following > http://wiki.tinycorelinux.com/cups1311
installed the following software with AppBrowser set to onboot
cups1311
nano
openssh
lynx
gutenprint

Added.
/usr/local/etc/init.d/dbus start
/etc/init.d/cups start
To /opt/bootlocal.sh

set my root password and added
etc/shadow
to /opt.filetool.lst

I also added
etc/cups
to /opt/.filetool.lst
Assuming that would be needed to save changes I make to /etc/cups/cupsd.conf

upon reboot both.
sudo /usr/local/etc/init.d/dbus status
sudo /etc/init.d/cups status
give good results, saying they are ok

But when I try to start editing /etc/cups/cupsd.conf and save changes I am told the file is read only.

Sooo i'm kind of stuck now, any advice welcomed

PS, does tinycore look for a persistent settings file on any attached usb drive/floppy/the tinycore cd during bootup ?
Live long and prosper.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Cups Print Server
« Reply #3 on: March 14, 2011, 10:59:00 PM »
I assume you are using sudo vi /etc/cups/cupsd.conf or what does ls -l /etc/cups/cupsd.conf show?

EDIT: During the boot process TC will automatically look for a 'tce' directory in all attached file systems (of supported types, e.g. EXT[2-4], FAT, VFAT). IIRC it takes the first one it finds, so it would be a good idea to use the 'tce=...' boot code (in the boot loader configuration) to provide "guidance" in this search. Also note that the 'waitusb=...' boot code is typically required for all this to work for USB devices. I'd suggest to study the FAQ and / or use the earch function of the forum to find more information about this.
« Last Edit: March 14, 2011, 11:06:12 PM by maro »

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: Cups Print Server
« Reply #4 on: March 15, 2011, 12:22:33 AM »
Hi Marco, thanks for your replay,

I used "sudo nano /etc/cups/cupsd.conf" to try to edit the /etc/cups/cupsd.conf file as its an editor i have basic experience with.

I also tried sudo vi /etc/cups/cupsd.conf" both vi and nano give a read only error when trying to save the cupsd.conf file.

This is a new one for me, i've got the root password sorted out on boot, but I can't edit the file even if i su first.
Live long and prosper.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Cups Print Server
« Reply #5 on: March 15, 2011, 12:24:20 AM »
Again, what does ls -l /etc/cups/cupsd.conf show?

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14475
Re: Cups Print Server
« Reply #6 on: March 15, 2011, 08:05:48 AM »
extensions should copy conf files to the filesystem rather than leaving them linked to the read-only file under /tmp/tcloop/extension_name.

you can delete /etc/cups/cupsd.conf and copy /tmp/tcloop//etc/cups/cupsd.conf to take its place - it will then be editable.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Cups Print Server
« Reply #7 on: March 15, 2011, 08:18:39 AM »
The problem will remain that restore will not be able to restore the config file because the symbolic link still points to a ro file.
The kit needs to be fixed.

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: Cups Print Server
« Reply #8 on: March 15, 2011, 09:12:28 PM »
Quote
Again, what does ls -l /etc/cups/cupsd.conf show?

Sorry about the delay, pc is at work,

Ok
Code: [Select]
lrwxrwxrwx    1 root     root            40 Mar 16 03:45 /etc/cups/cupsd.conf -> /tmp/tcloop/cups1311/etc/cups/cupsd.conf

Hope this helps.
-----------------------------------------------------------------------------
Update,
Ok, i've deleted the /etc/cups/cupsd.conf link file, and copied /tmp/tcloop/cups1311/etc/cups/cupsd.conf to /etc/cups/
Is this really required ? Perhaps its something i've done wrong, or a side effect of installing tinycore linux to hd ?

Then I changed ownership of /etc/cups/cupsd.conf with
Code: [Select]
sudo chown tc /etc/cups/cupsd.conf I could then edit and save changes to /etc/cups/cupsd.conf using user tc.
Code: [Select]
ls -l /etc/cups/cupsd.conf showed user as tc and group as staff

upon shutdown with backup and reboot

ls -l /etc/cups/cupsd.conf showed root as the owner and staff as group, I now have to edit /etc/cups/cupsd.conf with
Code: [Select]
sudo nano /etc/cups/cupsd.conf which is ok, I then rebooted and could see my changes to /etc/cups/cupsd.conf as persisting  ;D

my /opt/.filetool.lst file now looks like this
Code: [Select]
opt/bootlocal.sh
opt/bootsync.sh
opt/shutdown.sh
opt/tcemirror
opt/.filetool.lst
opt/.xfiletool.lst
home
etc/cups/cupsd.conf
etc/cups/printers.conf
etc/cups/ppd
etc/hosts

I got an error during reboot/backup as etc/cups/printers.conf does not exist yet, but I created a blank file to keep the system happy. Sorry if doing this is very dumb, im a newbie, and was just trying to get the system to reboot, I made an assumption that when i add a printer later, I'll need that file to persist a backup, ASSUMING THATS WHAT THE FILE IS FOR.

made the following changes to /etc/cups/cupsd.conf with > sudo nano /etc/cups/cupsd.conf
Code: [Select]
# "$Id: cupsd.conf.in 7199 2008-01-08 00:16:30Z mike $"
#
#   Sample configuration file for the Common UNIX Printing System (CUPS)
#   scheduler.  See "man cupsd.conf" for a complete description of this
#   file.
#

# Log general information in error_log - change "info" to "debug" for
# troubleshooting...
LogLevel info

# Administrator user group...
SystemGroup root


# Only listen for connections from the local machine.
Listen 631
Listen /var/run/cups/cups.sock

# Show shared printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAllow all

# Default authentication type, when authentication is required...
DefaultAuthType Basic
DefaultEncryption Never

# Restrict access to the server...
<Location />
  Order deny,allow
  allow all
</Location>

# Restrict access to the admin pages...
<Location /admin>
  Order deny,allow
  allow all
</Location>

# Restrict access to configuration files...
<Location /admin/conf>
  AuthType None
  Require user @SYSTEM
  Order deny,allow
  allow all
</Location>

# Set the default printer/job policies...
<Policy default>
  <Limit All>
    Order deny,allow
    allow all
  </Limit>
</Policy>

#
# End of "$Id: cupsd.conf.in 7199 2008-01-08 00:16:30Z mike $".
#

then i ran sudo /etc/init.d/cups restart

I just accessed my print server via google chrome from another computer, using its ip address http://10.1.1.202:631

Sooo tried accessing the server from another computer using http://box:631 and received
Code: [Select]
Oops! Google Chrome could not find box:631 from google chrome, I edited /etc/hosts file to include >10.1.1.202    box< added etc/hosts to /opt/.filetool.lst and rebooted. Still no luck acessing computer, so another look at /etc/hosts showed first line as >127.0.0.1  box   localhost<  I removed box from this line, my /etc/hosts file now looks like
Quote
127.0.0.1    localhost
10.1.1.202    box
rebooted with backup, but still can't access cups remotly using hostname, well i'm not going to worry about this for now.

I'm moving the computer over to the current print server running ubuntu, i'll replace it with tinycore linux and see if I can add the printer, share it and access it, will report back soon.

« Last Edit: March 15, 2011, 11:05:52 PM by remus »
Live long and prosper.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Cups Print Server
« Reply #9 on: March 16, 2011, 06:52:48 PM »
@remus: The difficulties you've seen related to the host name 'box' are a consequence of the fact that by default all TC systems will use the same host name. To change this one could use the boot code 'host=...' or try some other approach (as discussed just a few days ago). I can imagine that just changing the entry in '/etc/hosts' might not be enough, and attempting to make this change persistent via backup will probably not work either.

BTW, the problem with the '/etc/cups/cupsd.conf' file is nothing you've done wrong. As gerald_clark has already pointed out the issue is due to the way the 'cups1311.tcz' extension was build, and would require a correction on that level. I'm not sure whether this will happen soon (if at all) as the original extension creator (i.e. user 'perthie') appears to have been rather inactive in the last couple of month.

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: Cups Print Server
« Reply #10 on: March 16, 2011, 07:08:57 PM »
Thanks for the input Maro, and for clarifying what gerald_clark said,
Quote
The kit needs to be fixed
I made the mistake of assuming gerald_clark was talking about tinycore linux  ::)

I've yet to sort out adding the printer, i'm going to take a look to see if there are hp driver extensions available for tinycore linux when I get to work later, and install openssh

each step forward is worth the sweat :)
Live long and prosper.

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14475
Re: Cups Print Server
« Reply #11 on: March 16, 2011, 08:28:37 PM »
i'm going to take a look to see if there are hp driver extensions available for tinycore linux when I get to work later

..if you mean hplip, there is an extension

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Cups Print Server
« Reply #12 on: March 16, 2011, 10:02:43 PM »
A patch you can try is to create a config file named cupsd.conf.new.
edit .filetool.lst to back up this file.

Add a line in bootlocal.sh that deletes cupsd.conf and symlinks cups.conf.new to cupsd.conf.
Add another line to bootlocal.sh that starts cups.

Another option is to start cups with the option to use a different config file if possible.
« Last Edit: March 16, 2011, 10:05:50 PM by gerald_clark »

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: Cups Print Server
« Reply #13 on: March 18, 2011, 09:39:42 PM »
Thanks gerald_clark, i'm happy to delete the files in /etc/cups and replace them with the sym link files.

I'm been thinking of writing a shell script to take care of this for me in the future, then I started thinking about updating the extension, haven't looked into how thats done yet :)

Also, i'm wondering why people are using the old version of cups over the new version ???
Live long and prosper.

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14475
Re: Cups Print Server
« Reply #14 on: March 18, 2011, 11:46:29 PM »
Also, i'm wondering why people are using the old version of cups over the new version

As mentioned earlier (or maybe in a different thead), there were a lot of problems with the cups usb backend and the kernel module usblp in early versions of cups-1.4.x

This should be fixed in the later versions of cups-1.4.x, but I am unable to check it as I need to use the hp backend with the printers I have access to.