Bug 776 - "make install" does not create the startup links for /etc/init.d/xprint
Summary: "make install" does not create the startup links for /etc/init.d/xprint
Alias: None
Product: xprint
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: high critical
Assignee: Roland Mainz
QA Contact:
Depends on:
Reported: 2004-06-21 01:30 UTC by Roland Mainz
Modified: 2008-05-27 01:41 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:

Patch for 2004-07-12-trunk (work-in-progress) (4.76 KB, patch)
2004-07-13 01:22 UTC, Roland Mainz
no flags Details | Splinter Review
Patch for 2004-07.13-trunk to fix "make install" bustage on Linux (3.00 KB, patch)
2004-07-13 12:15 UTC, Roland Mainz
no flags Details | Splinter Review

Description Roland Mainz 2004-06-21 01:30:45 UTC
"make install" in the Xorg trunk does not create the startup links for
/etc/init.d/xprint in the single runlevel dirs, e.g. /etc/init.d/rc3.d/ etc.

Two problems:
1. The installation procedure dramatically differs between the single Linux and
Unix versions
2. Some official tools like the LSB /usr/lib/lsb/install_initd seem to have no
way to specify an alternative "root" dir, e.g. installing into a temporary
localtion using "make install DESTDIR=/tmp/xptestinstall002" does not work...

Right now the xprint.spec for RPM uses the following sequence to create the
neccesary links:
-- snip --
if [ -x /usr/lib/lsb/install_initd ] ; then
    # (hopefully) LSB-compliant distribution
    /usr/lib/lsb/install_initd /etc/init.d/xprint
    if [ -f /etc/redhat-release ] ; then
        if [ $1 = 1 ]; then
            /sbin/chkconfig --add xprint
        # SuSE(-like) ?
        if [ -d /etc/rc.d/rc2.d/ ] ; then
            echo "# Detected SuSE(-like) distribution"
            echo "# Creating links..."
            ln -sf ../xprint /etc/rc.d/rc2.d/K21xprint
            ln -sf ../xprint /etc/rc.d/rc2.d/S21xprint
            ln -sf ../xprint /etc/rc.d/rc3.d/K21xprint
            ln -sf ../xprint /etc/rc.d/rc3.d/S21xprint

            # Older SuSE versions (like SuSE 6.4) do not have /etc/init.d/
            if [ ! -f /etc/rc.d/xprint ] ; then
                echo "# Creating old SuSE compatibility link..."
                ln -s /etc/init.d/xprint /etc/rc.d/xprint
            # RedHat(-like) ?
            if [ -d "/etc/rc1.d" -a -d "/etc/init.d/" ] ; then
                echo "# Detected RedHat(-like) distribution"
                echo "# Creating links..."             
                ln -sf /etc/init.d/xprint /etc/rc.d/rc0.d/K61xprint
                ln -sf /etc/init.d/xprint /etc/rc.d/rc1.d/K61xprint
                ln -sf /etc/init.d/xprint /etc/rc.d/rc2.d/S61xprint
                ln -sf /etc/init.d/xprint /etc/rc.d/rc3.d/S61xprint
                ln -sf /etc/init.d/xprint /etc/rc.d/rc4.d/S61xprint
                ln -sf /etc/init.d/xprint /etc/rc.d/rc5.d/S61xprint
                ln -sf /etc/init.d/xprint /etc/rc.d/rc6.d/K61xprint
                echo "# Unsupported version of Linux, cannot create links for
                exit 1
-- snip --

It seems we have to stick something similar into the Imakefile build system..

Any suggestions/ideas ? Are there any standard tools in LSB and/or Debian which
work even with the installation to a temporary location ?
Comment 1 Roland Mainz 2004-06-21 01:31:25 UTC
Comment 2 Roland Mainz 2004-07-13 01:22:31 UTC
Created attachment 469 [details] [review]
Patch for 2004-07-12-trunk (work-in-progress)
Comment 3 Roland Mainz 2004-07-13 01:28:14 UTC
Attachment attachment 469 [details] [review] checked-in...

/cvs/xorg/xc/ChangeLog,v  <--  ChangeLog
new revision: 1.90; previous revision: 1.89
/cvs/xorg/xc/programs/Xserver/Xprint/etc/init.d/Imakefile,v  <--  Imakefile
new revision: 1.3; previous revision: 1.2

... leaving bug open for now until we figured-out a solution to do this in a
LSB-compilant way (right now the LSB script to create links for /etc/init.d
scripts only works as user "root" and only changes links in /etc/init./, not
relative to a given base dir... ;-(( ).
Comment 4 Roland Mainz 2004-07-13 12:15:41 UTC
Created attachment 471 [details] [review]
Patch for 2004-07.13-trunk to fix "make install" bustage on Linux
Comment 5 Roland Mainz 2004-07-13 12:18:11 UTC
attachment 471 [details] [review] checked-in:
/cvs/xorg/xc/programs/Xserver/Xprint/etc/init.d/Imakefile,v  <--  Imakefile
new revision: 1.4; previous revision: 1.3
Comment 6 Roland Mainz 2004-07-13 15:32:03 UTC
Someone on IRC pointed out that /usr/lib/lsb/install_initd accepts no-/etc
paths, too - which means we could simply use...
-- snip --
/usr/lib/lsb/install_initd $(DESTDIR)/etc/init.d/xprint
-- snip --
...on LSB-compilant Linux distributions.

Is this a non-standard feature of the SuSE version of /usr/lib/lsb/install_initd
or is that supported by all LSB implementations ?
Comment 7 Stefan Dirsch 2004-08-07 01:05:51 UTC
Roland, I can't comment on LSB as I'm not an expert in this area, but for SuSE 
Linux it's sufficient to install a init script to /etc/init.d and to call 
"insserv -d <scripname>" after this, which will create the according symlinks 
depending on the definitions in the header of the script. Your xprint script 
already has such a header. I'm already calling insserv in the %post of SuSE's 
next xorg-x11-Xprt package and it seems to work fine. 
Comment 8 Drew Parsons 2005-02-24 05:33:09 UTC
Sorry I didn't comment on this earlier.  Debian has a standard tool for setting
up the links: update-rc.d. It's invoked in the installation scripts (postinst, etc).

To make my life even easier, we have a commonly used debhelper tool,
(dh_installinit), which places the code into postinst automatically when I
create the binary deb files.

update-rc.d is provided by the sysvinit package.
Comment 9 Stefan Dirsch 2008-05-27 01:41:25 UTC
Looks like building xprint is no longer possible. ==> WONTFIX

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.