0

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.

hornetbzz
  • 170
  • 9

3 Answers3

3
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.

Zoredache
  • 128,755
  • 40
  • 271
  • 413
  • Thx, understood. I'll try that. From the [incrond man page](http://linux.die.net/man/8/incrond), the incron daemon can run w/o arguments – hornetbzz May 08 '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 08 '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 08 '12 at 22:28
1

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?

cjc
  • 24,533
  • 2
  • 49
  • 69
  • 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 08 '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 08 '12 at 22:51
0

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.

stew
  • 9,263
  • 1
  • 28
  • 43
  • 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 08 '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 08 '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