Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm triying to start the incron daemon "incrond" at boot but doesn't work.

I have done :

ln -s /usr/sbin/incrond /etc/init.d/incrond
chmod 755 /etc/init.d/incrond
update-rc.d incrond enable

But no "incrond" pid is running there.

Question
Shall I absolutely use /etc/init.d/skeleton as a starting point or is it still possible to symlink to the existing "incrond" daemon, and how then ?

Note:
I don't have "service name start" available on this Lenny distro.


EDIT : as a cook book, here is the way I solved it thx to the hints of the answers

# Update the discontinued Lenny sources list ("vim /etc/apt/sources.list")
# Reinstall incron ("aptitude reinstall incron"), maybe should also reinstall inotify-tools
# Create manually the famous missing start script ("vim /etc/init.d/incron" and, chmod 755 this file)
# Run the daemon at boot ("update-rc.d incron enable")
# Check start/stop args passed to the daemon ("/etc/init.d/incron restart" and then, "pidof incrond")
# Reboot and control again that the daemon incrond is running (use "pidof" or "ps -ef | grep incron" or "cat /var/run/incron.pid")

Note: I found a good basis for the start script here, but did not face this incrond timeout issue.

share|improve this question

3 Answers 3

up vote 3 down vote accepted
ln -s /usr/sbin/incrond /etc/init.d/incrond

It doesn't work like that. When the the system runs the various startups scripts for a run-level you it will pass it an arguments like start, stop, restart and so on. You can't just symlink to the daemon binary, since that binary will either fail, or not properly respond when passed those arguments.

You will almost certainly need to create a startup script. It doesn't have to be a copy of skeleton, but it must accept at least the start, stop, and restart arguments.

share|improve this answer
    
Thx, understood. I'll try that. From the incrond man page, the incron daemon can run w/o arguments –  hornetbzz May 8 '12 at 20:57
    
@hornetbzz, but that is exactly the point. When the system is being started it will pass an argument, that the binary is certainly not going to accept. The question isn't what it will do without an argument, the question is what will it do with an invalid argument. –  Zoredache May 8 '12 at 21:26
    
Thx, I was not aware on how startup scripts were working. I edited my question with the final working solution. –  hornetbzz May 8 '12 at 22:28

No, it shouldn't be possible to do what you're doing. What's in /etc/init.d (and managed using update-rc.d) are specially formatted shell scripts that call the specified binaries. Just linking that binary into /etc/init.d isn't going to do anything useful.

How did you install incron? I don't run Debian, but the Ubuntu (Lucid) package for incron includes /etc/init.d/incron, which is the correct init script for the service. Yes, you can use /etc/init.d/skeleton as a starting point, but, really, there should have been an init script already in your package.

What does dpkg -L incron say?

share|improve this answer
    
Thx. The debian lenny repo is discontinued since March'12, so I changed the sources list to the archives repository. dpkg -L incron refers to /etc/init.d/incron but there is none in the real /etc/init.d directory list. –  hornetbzz May 8 '12 at 20:56
    
@hornetbzz I think you can just grab the equivalent Ubuntu .deb file, unpack it, and get at the init script from that. –  cjc May 8 '12 at 22:51

the debian incron package already provides an /etc/init.d/incron script, which should be enabled by default. You would normally just install the package and have it running.

Now that you've altered this file, and since it is a conffile, the package manager will not replace your version with the packaged version. I'd recommend removing your /etc/init.d/incron script then run

apt-get -o DPkg::Options::='--force-confmiss' reinstall incron

To force the package manager to replace the missing conffile.

share|improve this answer
    
Thx, I guess I've first to update again the sources list, as missing portions may have caused these troubles. Also I always use aptitude and not apt-get. –  hornetbzz May 8 '12 at 21:16
    
the same command will work with aptitude. The new location for lenny is http://archive.debian.org/debian lenny main. missing portions can't have caused these troubles. if the incron package was installed and /etc/init.d/incron didn't exist, and this command makes it reappear, then someone deleted it. –  stew May 8 '12 at 23:29
    
thx, nbdy deleted it. I rather guess the incorrect apt sources list corrupted the installation. The sources list update to archives solved the issue as mentionned in the EDIT part of the question. –  hornetbzz May 10 '12 at 21:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.