LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-05-2017, 09:49 PM   #1
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,077

Rep: Reputation: 43
rc-local.service not working in Debian Stable9


I know rc.local is not encouraged, but for sake of simplicity I want to use it. I have a simple /etc/rc.local file on my Debian Stable System. But when I try following command, it does not work:

Code:
$ sudo systemctl enable rc-local.service
The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
settings in the [Install] section, and DefaultInstance for template units).
This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).
4) In case of template units, the unit is meant to be enabled with some
   instance name specified.
Subsequent status check shows:

Code:
$ sudo systemctl status rc-local.service
● rc-local.service - /etc/rc.local Compatibility
   Loaded: loaded (/lib/systemd/system/rc-local.service; static; vendor preset: enabled)
  Drop-In: /lib/systemd/system/rc-local.service.d
           └─debian.conf
   Active: failed (Result: exit-code) since Thu 2017-07-06 07:39:07 IST; 39min ago

Jul 06 07:39:07 debian-netinst systemd[1]: Starting /etc/rc.local Compatibility...
Jul 06 07:39:07 debian-netinst rc.local[716]: rm: cannot remove '/home/abcde/.thumbnails/normal/*.png': No such file or directory
Jul 06 07:39:07 debian-netinst systemd[1]: rc-local.service: Control process exited, code=exited status=1
Jul 06 07:39:07 debian-netinst systemd[1]: Failed to start /etc/rc.local Compatibility.
Jul 06 07:39:07 debian-netinst systemd[1]: rc-local.service: Unit entered failed state.
Jul 06 07:39:07 debian-netinst systemd[1]: rc-local.service: Failed with result 'exit-code'.
Where is the problem and how can it be solved? Thanks for your help.
 
Old 07-06-2017, 09:10 PM   #2
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 329Reputation: 329Reputation: 329Reputation: 329
"rm" will fail if the directory is empty. Try using "rm -f".
 
Old 07-06-2017, 09:23 PM   #3
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,077

Original Poster
Rep: Reputation: 43
I think it will also work if I create a file in that folder so that it is never found empty:

Code:
touch /home/abcde/.thumbnails/normal/temp.png
rm /home/abcde/.thumbnails/normal/*.png
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I'm so confused - Setting FQDN when Service is Local bhfisher Linux - Newbie 4 09-11-2016 11:15 AM
Linux.local is connecting on the ipp service Toadman Linux - Security 1 11-14-2013 01:53 PM
Publishing a local website using NO-IP (free service) in CentOS kfaday Linux - Networking 1 11-15-2011 08:58 PM
Rotating logs in squid 2.7 stable9 arunabh_biswas Linux - Server 3 08-16-2010 02:18 AM
Local Name Service for win98 and linux sogenant Linux - Server 4 06-03-2008 01:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 10:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration