[bug-notifications] [alternatives 0004559]: --set does not work

Mantis Bug Tracker noreply at opencsw.org
Sun Oct 3 14:26:49 CEST 2010


A NOTE has been added to this issue. 
====================================================================== 
https://www.opencsw.org/mantis/view.php?id=4559 
====================================================================== 
Reported By:                holzi
Assigned To:                phil
====================================================================== 
Project:                    alternatives
Issue ID:                   4559
Category:                   regular use
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     feedback
====================================================================== 
Date Submitted:             2010-09-30 15:47 CEST
Last Modified:              2010-10-03 14:26 CEST
====================================================================== 
Summary:                    --set does not work
Description: 
during testing the new apache2 package I wanted to change the alternative:

/opt/csw/sbin/alternatives --display httpd
Installed alternatives for httpd are:
/opt/csw/apache2/sbin/httpd httpd /opt/csw/apache2/sbin/httpd.prefork 100
/opt/csw/apache2/sbin/httpd httpd /opt/csw/apache2/sbin/httpd.worker 50


/opt/csw/sbin/alternatives --set httpd /opt/csw/apache2/sbin/httpd.worker

ln: cannot create /etc/opt/etc/alternatives/httpd: No such file or
directory

====================================================================== 

---------------------------------------------------------------------- 
 (0008334) bwalton (developer) - 2010-10-03 14:26
 https://www.opencsw.org/mantis/view.php?id=4559#c8334 
---------------------------------------------------------------------- 
I added an extra debugging line too to print the content of $line just
before the set_link call.

The altneratives stuff is pretty stock.  I used the built in GAR support
for this and have a file /opt/csw/share/altneratives/apache2 containing:

# cat /opt/csw/share/alternatives/apache2 
/opt/csw/apache2/sbin/httpd httpd /opt/csw/apache2/sbin/httpd.prefork 100
/opt/csw/apache2/sbin/httpd httpd /opt/csw/apache2/sbin/httpd.worker 50


This is, afaik, a valid file.  Both altnernatives are being shipped in the
same package, so the altnatives file has 2 lines.  Anyway, I still think
alternatives is doing something wrong here...debug output:

# DEBUG=echo alternatives --set httpd /opt/csw/apache2/sbin/httpd.worker 
found match for httpd: /opt/csw/share/alternatives/apache2
set_alternative called with httpd
line is: /opt/csw/apache2/sbin/httpd httpd
/opt/csw/apache2/sbin/httpd.prefork 100 /opt/csw/apache2/sbin/httpd httpd
/opt/csw/apache2/sbin/httpd.worker 50
set_link called with: /opt/csw/apache2/sbin/httpd httpd
/opt/csw/apache2/sbin/httpd.prefork
removing symlink /opt/csw/apache2/sbin/httpd
linking /opt/csw/apache2/sbin/httpd to
/opt/csw/apache2/sbin/httpd.prefork
set_link called with: /opt/csw/apache2/sbin/httpd httpd
/opt/csw/apache2/sbin/httpd.worker
removing symlink /opt/csw/apache2/sbin/httpd
linking /opt/csw/apache2/sbin/httpd to /opt/csw/apache2/sbin/httpd.worker
set_link called with: 50
ERROR: set_link needs 3 arguments
/opt/csw/sbin/alternatives[55]: shift: bad number



More information about the bug-notifications mailing list