Re: Editing /etc/rc.local [was: How to run a command / script on startup automatically in linux?]

2023-05-16 Thread Vincent Lefevre
On 2023-05-16 06:36:34 +0200, to...@tuxteam.de wrote:
> On Mon, May 15, 2023 at 11:05:07PM +0200, Vincent Lefevre wrote:
> > On 2023-05-15 15:56:17 -0400, Greg Wooledge wrote:
> 
> [editing /etc/rc.local is a bad idea]

No, entirely *replacing* /etc/rc.local is a bad idea.

> > > That's incorrect.
> > 
> > It is correct, as shown by the following command:
> > 
> > zira:~> dlocate etc/rc.local
> > initscripts: /etc/rc.local
> > 
> > Ditto with "apt-file search etc/rc.local".
> 
> I'm with Greg here. /etc/rc.local is package-provided, but it is
> a conffile [1], [2]:
> 
>   tomas@trotzki:~$ dpkg --status initscripts
>   Package: initscripts
>   Status: install ok installed
>   Priority: optional
>   [...]
>   Conffiles:
>/etc/default/devpts 725336081392e54776899acd2bff6e39
>[...]
>/etc/rc.local 12fe1992accd3a3977b4d8985ebeea9e
>   [...]
> 
> It's there for you, the system administrator to edit and change.
> The packaging system is explicitly designed to cope with that
> situation (technically it keeps a fingerprint of the pristine
> file and checks that on updates giving you, the sysadmin, the
> chance to forward-port your changes).

Yes, this is *allowed*. But you should not recommend that to users
without knowing the possible consequences on their machines. This is
not because it a conffile that you can do anything with it without
breaking parts of the system.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Editing /etc/rc.local [was: How to run a command / script on startup automatically in linux?]

2023-05-15 Thread tomas
Changed $SUBJECT, because already way off track.

On Mon, May 15, 2023 at 11:05:07PM +0200, Vincent Lefevre wrote:
> On 2023-05-15 15:56:17 -0400, Greg Wooledge wrote:

[editing /etc/rc.local is a bad idea]

> > That's incorrect.
> 
> It is correct, as shown by the following command:
> 
> zira:~> dlocate etc/rc.local
> initscripts: /etc/rc.local
> 
> Ditto with "apt-file search etc/rc.local".

I'm with Greg here. /etc/rc.local is package-provided, but it is
a conffile [1], [2]:

  tomas@trotzki:~$ dpkg --status initscripts
  Package: initscripts
  Status: install ok installed
  Priority: optional
  [...]
  Conffiles:
   /etc/default/devpts 725336081392e54776899acd2bff6e39
   [...]
   /etc/rc.local 12fe1992accd3a3977b4d8985ebeea9e
  [...]

It's there for you, the system administrator to edit and change.
The packaging system is explicitly designed to cope with that
situation (technically it keeps a fingerprint of the pristine
file and checks that on updates giving you, the sysadmin, the
chance to forward-port your changes).

Cheers

[1] https://www.debian.org/doc/manuals/maint-guide/dother.en.html#conffiles
[2] 
https://raphaelhertzog.com/2010/09/21/debian-conffile-configuration-file-managed-by-dpkg/
-- 
tomás


signature.asc
Description: PGP signature