Bug 699826

Summary: ypinit -m fails with No rule to make target `/etc/mail/aliases'
Product: [Fedora] Fedora Reporter: Stefan Krüger <stadtkind2>
Component: ypservAssignee: Honza Horak <hhorak>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 16CC: edwinh, hhorak, kklic
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ypserv-2.26-9.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-24 20:01:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stefan Krüger 2011-04-26 17:30:58 UTC
Description of problem:
running /usr/lib/yp/ypinit -m fails with:

...
gmake[1]: *** No rule to make target `/etc/mail/aliases', needed by `mail.aliases'.  Stop.
gmake[1]: Leaving directory `/var/yp/nisdomain.test'
make: *** [target] Error 2
Error running Makefile.
Please try it by hand.

And indeed, there's no such file '/etc/mail/aliases' (but /etc/aliases exists)

Version-Release number of selected component (if applicable):
ypserv-2.23-4.fc14.i686

How reproducible:
happens every time


Steps to Reproduce:
1. set your NIS domainname with 'nisdomain'
2. run '/usr/lib/yp/ypinit -m'
  
Actual results:
see above

Expected results:
gmake[1]: Leaving directory `/var/yp/nisdomain.test'

fedora14.localdomain has been set up as a NIS master server.

Now you can run ypinit -s fedora14.localdomain on all slave server.



Additional info:
ln -sf /etc/aliases /etc/mail/aliases for a QnD solution

Comment 1 Fedora Update System 2011-05-06 13:01:46 UTC
ypserv-2.24-4.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/ypserv-2.24-4.fc15

Comment 2 Fedora Update System 2011-05-07 15:06:02 UTC
Package ypserv-2.24-4.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing ypserv-2.24-4.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/ypserv-2.24-4.fc15
then log in and leave karma (feedback).

Comment 3 Stefan Krüger 2011-05-11 17:20:38 UTC
Still fails, sorry

# uname -a
Linux localhost.localdomain 2.6.38.5-24.fc15.x86_64 #1 SMP Fri May 6 08:00:28 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
# rpm -qa | grep ypserv
ypserv-2.24-4.fc15.x86_64
# /usr/lib64/yp/ypinit -m
...
gmake[1]: *** No rule to make target `/etc/mail/aliases', needed by `mail.aliases'.  Stop.
gmake[1]: Leaving directory `/var/yp/example.tld'
make: *** [target] Error 2
Error running Makefile.
Please try it by hand.

Comment 4 Honza Horak 2011-05-12 06:21:05 UTC
(In reply to comment #3)
> Still fails, sorry

That's right, because /var/yp/Makefile is considered as a config file, so it is not changed during update. If you removed ypserv at all (remove /var/yp/Makefile also), then it would work after next ypserv install. If you have any test machine, you can give it a try.

Comment 5 Stefan Krüger 2011-05-12 10:11:12 UTC
I tested this on a fresh F15 BETA installation from the Fedora Desktop Live Media. IIRC ypserv is not installated when using the live cd, so /var/yp/* should not have existed at all when I installed (as I said, fresh installation, ypserv was not installed and thus not updated in any way) ypserv-2.24-4.fc15.x86_64.

Comment 6 Honza Horak 2011-05-12 11:56:29 UTC
I'm sorry, you were right. The new build is on the way.

Comment 7 Fedora Update System 2011-05-12 14:35:59 UTC
ypserv-2.24-5.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/ypserv-2.24-5.fc15

Comment 8 Fedora Update System 2011-05-25 03:31:06 UTC
ypserv-2.24-5.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Stefan Krüger 2012-01-11 17:21:12 UTC
Broken again on F16:

# /usr/lib64/yp/ypinit -m
[...]
gmake[1]: *** No rule to make target `/etc/mail/aliases', needed by `mail.aliases'.  Stop.
gmake[1]: Leaving directory `/var/yp/my.lan.tld'
make: *** [target] Error 2
Error running Makefile.
Please try it by hand.

# rpm -qa | grep yp
yp-tools-2.12-6.fc16.x86_64
ypbind-1.33-9.fc16.x86_64
ypserv-2.26-8.fc16.x86_64

Also NISDOMAIN from /etc/sysconfig/network is not set anymore when ypserv (but not ypbind) is enabled (i.e. running domainname after reboot prints nothing)

PS: I wasn't sure if I had to open a new bug for this one?

Comment 10 Honza Horak 2012-01-11 17:47:36 UTC
(In reply to comment #9)
> Broken again on F16:
> 
> # /usr/lib64/yp/ypinit -m
> [...]
> gmake[1]: *** No rule to make target `/etc/mail/aliases', needed by
> `mail.aliases'.  Stop.
> gmake[1]: Leaving directory `/var/yp/my.lan.tld'
> make: *** [target] Error 2
> Error running Makefile.
> Please try it by hand.
> 

Did you update ypserv package or install it on a machine where no ypserv had been before? If you updated, /var/yp/Makefile wasn't changed, because it's treated as a configuration file. So this behavior would be expected.

> # rpm -qa | grep yp
> yp-tools-2.12-6.fc16.x86_64
> ypbind-1.33-9.fc16.x86_64
> ypserv-2.26-8.fc16.x86_64
> 
> Also NISDOMAIN from /etc/sysconfig/network is not set anymore when ypserv (but
> not ypbind) is enabled (i.e. running domainname after reboot prints nothing)

You're right, this seems to be forgotten when the package was converted from SysV init script to native systemd unit file. I'm going to fix it.
 
> PS: I wasn't sure if I had to open a new bug for this one?

This is ok, thanks for reporting.

Comment 11 Stefan Krüger 2012-01-11 18:10:10 UTC
This happens on a fresh F16 installation.

Comment 12 Fedora Update System 2012-01-12 16:03:55 UTC
ypserv-2.26-9.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/ypserv-2.26-9.fc16

Comment 13 Honza Horak 2012-01-12 16:04:40 UTC
(In reply to comment #11)
> This happens on a fresh F16 installation.

I've found the problem - the upstream routine for searching the aliases file path doesn't work even if default value /etc/aliases has been passed, so provided a new one. 

Also a script to respect NISDOMAIN environment variable during start of ypserv service has been added.

Feel free to try the update above if you want.

Comment 14 Fedora Update System 2012-01-15 19:57:54 UTC
Package ypserv-2.26-9.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing ypserv-2.26-9.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-0486/ypserv-2.26-9.fc16
then log in and leave karma (feedback).

Comment 15 edwinh 2012-01-18 18:02:01 UTC
This just hit me after updating to f16. 

The domain-setting part not the aliases part.  This was devilishly annoying... no domainname on the machine when it came up, ypmake broken... went down a networkmanager + systemd rabbit hole last night, added a domin-setting script to run after interfaces up, but now just found this bugzilla.

Am sure more people have hit this, can't be too uncommon of a setup?

Anyway pulled from updates-testing, thanks

Comment 16 Fedora Update System 2012-01-24 20:01:58 UTC
ypserv-2.26-9.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.