LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-29-2021, 10:58 PM   #16
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656

Quote:
Originally Posted by enorbet View Post
I wasn't asking for ALL .new files to be more aware of customizations, just the ones that were never expected to be part of the base system but more to user discretion AND rarely ever change and almost never a critical component. One of the reasons this has reared it's head now instead of a decade ago, is slackpkg(+) even though it has been practiced for 2 decades or more. The difference is that after one does a "slackpkg upgrade-all" the very last user input is for what to do with ALL of the .new files and I sincerely doubt most folks know ahead of time exactly how many files that is, where they reside or if they will bork some user customization. There is no reference or list.
In fairness, people should never blindly accept all the changes if they know they've made changes to files in /etc/. That's just asking for trouble. I *ALWAYS* select "prompt" and check through the diffs to see if the files are ok to overwrite, if I can ignore the changes, or if I need to manually adjust the files (there's changes from upstream to the config and I've made my own changes to the config).

I don't have any problems if the placement of rc.local and other files were adjusted to prevent accidental overwriting (I'm fine with keeping it the same or switching to the .sample proposed in this thread), but if accidental overwriting does occur, that's on the part of a poor sysadmin blindly accepting config changes without review. That's just a recipe for disaster.

I wonder if a better argument could be for slackpkg to ignore certain .new files or to allow users to blacklist certain .new files from being handled by new-config.

Last edited by bassmadrigal; 01-29-2021 at 10:59 PM.
 
5 members found this post helpful.
Old 01-30-2021, 01:24 AM   #17
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,799

Original Poster
Rep: Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437
Thank you bassmadrigal. I hadn't tried "prompt" which may go a ways toward what I'd prefer. Currently I choose "do nothing" and try to find them all before I reboot to see if any substantive changes have been made.

Speaking of which, and maybe a topic for another thread, as much as I love CLI (even more now since I learned about fzf), when doing batch work like searching for and editing numerous .new files, I still prefer a good file manager. I very much like Dolphin but I have yet to discover how to get it's "Find" function to allow wildcards. Obviously that would help a lot when all I want to find is *.new files within a specific directory structure, but one with many subdirectories. Do you know how to get wildcards enabled there?
 
Old 01-30-2021, 02:09 AM   #18
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,065

Rep: Reputation: Disabled
@enorbet: dotnew-gtk does what you want: https://github.com/gapan/dotnew
You made me realize that George converted the UI to Python 3 recently, so I will upgrade :-)
 
Old 01-30-2021, 02:44 AM   #19
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,378

Rep: Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757
Most Slackware packages that drop .new files have this stanza in the doinst.sh script.
Code:
config() {
  NEW="$1"
  OLD="$(dirname $NEW)/$(basename $NEW .new)"
  # If there's no config file by that name, mv it over:
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
  elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
    # toss the redundant copy
    rm $NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}
If the incoming .new file is the same as the existing file, it is automatically removed.
If the existing file is different then "leave the .new copy for the admin to consider...".

So, if you see a .new file, then either you have made a customisation in the existing file and/or there have been changes. These need to be reviewed.

Personally, I never make these changes in a GUI environment, an old habit from when changes in X could be problematic.

Running 'slackpkg new-config' will find any .new files and allow you to work through the list, choosing either 'Remove' (to remove the incoming .new file) or 'Overwrite' (to overwrite the old with the new). Like @bassmadrigal, I always use the 'Diff' option to look at changes and then may use the "Vimdiff' option to merge old customisations into the incoming .new file before doing an overwrite.

The rc.local.new thing is a storm in a teacup. It can be useful to check that your customisations are as you want.
 
Old 01-30-2021, 02:50 AM   #20
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,979

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
I have a rc.local with several entries in it. When there is a rc.local.new, it is only four key strokes to take care of things for rc.local

"p" (P)rompt K, O, R selection for every single file
"m" (M)erge
"l" # (L) to merge the left side with my changes
"i" (I)nstall the merged file

With the slackpkg beta version, the files with ".new" are listed for you.

Last edited by chrisretusn; 01-30-2021 at 02:57 AM.
 
1 members found this post helpful.
Old 01-30-2021, 02:53 AM   #21
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,915

Rep: Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033
For the few files like rc.local where one is very unlikely to ever want the stock version to replace a user's custom version, the obvious answer is to have the doinst.sh only move it into place if the target file does not already exist and delete it otherwise.

Having said that, it's not that onerous living with it the way it is: I see rc.local.new, I 'rm'. No need to even look.
 
2 members found this post helpful.
Old 01-30-2021, 02:57 AM   #22
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,550

Rep: Reputation: 3405Reputation: 3405Reputation: 3405Reputation: 3405Reputation: 3405Reputation: 3405Reputation: 3405Reputation: 3405Reputation: 3405Reputation: 3405Reputation: 3405
This thread remembers me of a famous debate at Vatican, where the cardinals argued (for several years) if the angels have two or four wings...

WTF people? So, everything works perfectly in -current?

Then, let's ask our BDFL to be kind to upgrade ICU without fallbacks!!!!

Last edited by LuckyCyborg; 01-30-2021 at 03:01 AM.
 
Old 01-30-2021, 06:23 AM   #23
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Quote:
Originally Posted by bassmadrigal View Post

I wonder if a better argument could be for slackpkg to ignore certain .new files or to allow users to blacklist certain .new files from being handled by new-config.
Cool idea, maybe the opposite also with a list of .new config files that could be automatically overwritten (for programs where default config is fine). But I am fine with the current way though

Last edited by keefaz; 01-30-2021 at 06:26 AM.
 
Old 01-30-2021, 06:48 AM   #24
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,378

Rep: Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757
Quote:
Then, let's ask our BDFL to be kind to upgrade ICU without fallbacks!!!!
Nothing breaks in stock -current when ICU is upgraded.
What breaks is third party packages, for which you took responsibility when you installed them.
 
1 members found this post helpful.
Old 01-30-2021, 12:53 PM   #25
eduardr
Member
 
Registered: Sep 2011
Distribution: Slackware64 14.2+ (-current)
Posts: 110

Rep: Reputation: Disabled
Quote:
Originally Posted by enorbet View Post
Thank you bassmadrigal. I hadn't tried "prompt" which may go a ways toward what I'd prefer. Currently I choose "do nothing" and try to find them all before I reboot to see if any substantive changes have been made.
I sometimes skip the .new's during the upgrade process and come back to them later via $ slackpkg new-config which looks for all the .new's and offers the prompt option.

Quote:
Originally Posted by enorbet View Post
Speaking of which, and maybe a topic for another thread, as much as I love CLI (even more now since I learned about fzf), when doing batch work like searching for and editing numerous .new files, I still prefer a good file manager.
A good option is to run $ slackpkg new-config with prompt in one terminal and run mc (Midnight Commander) in a second terminal to compare and edit the changed config files - CTRL-x CTRL-d (diff) and F3 (View) or F4 (Edit). mc has a lot of searching and filtering features too. Or use a Mac with the excellent ForkLift app (similar to mc) + Kaleidoscope (diff app) and diff and edit the Linux config files via ForkLift SFTP connections .
 
2 members found this post helpful.
Old 01-30-2021, 02:37 PM   #26
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,799

Original Poster
Rep: Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437
Please forgive me as I hadn't explored "P" for Prompt. It appears it and dotnew-gtk (thanks Didier) do what I really needed most, just to list so I know what I was about to ignore or overwrite and not be forced into a blind choice. That definitely smooths out workflow. I know... I'm obsessive about feedback. I hate it when an operation that takes more than 30 seconds doesn't keep me informed that it's working and sometimes even what it's working on. As Popeye said, "I yam what I yam".

My apologies if I dragged anyone through my mud, but I did learn cool stuff as a result. Hopefully at least someone else did too.

Last edited by enorbet; 01-30-2021 at 02:39 PM.
 
Old 02-01-2021, 09:08 AM   #27
santaslilslacker
Member
 
Registered: Nov 2007
Distribution: Slackware64_current
Posts: 45

Rep: Reputation: 27
Had same problem with rc.local and rc.mysqld... After some restores i used chattr +i and since then I don't care if I press wrong letter after upgrade. And it's lesser evil to chattr -i, edit, chattr + than to dig trough backups
 
1 members found this post helpful.
Old 02-01-2021, 09:43 AM   #28
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
A similar bother for me is when the system asks me to consider a .new file that only differs from the existing one in terms of customizations I have personally made to the existing one. (In other words, the "upstream" config file has not changed.) I went so far as to make some mods to installpkg in the past to prevent this from happening. But it's a non-trivial thing to change, requiring some sort of record of the "upstream" config file to be stored on the system, and Pat was understandably not interested in changing the behavior, so I moved on.
 
1 members found this post helpful.
Old 02-01-2021, 05:48 PM   #29
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,463
Blog Entries: 7

Rep: Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561
Quote:
Originally Posted by enorbet View Post
So my question is why aren't .new files limited to only those with either substantial and important changes or that only have to do with base system function? IMHO, "If it ain't broke, don't fix it" should apply.
Everyone here seems to be missing the fact that from a packaging perspective, it makes 100% sense to use "*.new" config files.

There is no possible way for the package builder to know what changes you've made, so it's up to you to decide what you want to keep.
Quote:
Originally Posted by enorbet View Post
It's not like they are even listed.
Code:
 # updatedb && locate *.new
It's not difficult.
 
Old 02-01-2021, 06:50 PM   #30
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,799

Original Poster
Rep: Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437Reputation: 4437
Quote:
Originally Posted by rkelsen View Post
Everyone here seems to be missing the fact that from a packaging perspective, it makes 100% sense to use "*.new" config files.

There is no possible way for the package builder to know what changes you've made, so it's up to you to decide what you want to keep.

Code:
 # updatedb && locate *.new
It's not difficult.
Difficulty wasn't the issue. Timing was. I didn't want to locate AFTER a blind choice was made. I wanted to make an informed choice in realtime (before they were written) and Prompt does a decent job at that.
 
2 members found this post helpful.
  


Reply



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
[SOLVED] .new files for /etc/passwd, /etc/shadow, etc. uiopqwerty Slackware 3 07-20-2020 06:45 AM
[SOLVED] /etc/rc.d/rc.local vs /usr/local/share Lysander666 Slackware 4 11-16-2018 03:28 PM
Why and how settings of mounting NFS in /etc/rc.local are overrided with /etc/fstab? yglin Linux - Newbie 7 04-30-2014 05:40 AM
What is the difference between /etc/init.d/boot.local and /etc/rc.d/boot.local..? mozart Linux - Newbie 3 06-13-2007 06:50 PM
ethernet, sound, compiling, etc etc etc polynotre Linux - Newbie 8 12-06-2003 08:13 AM

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

All times are GMT -5. The time now is 07:16 PM.

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
Open Source Consulting | Domain Registration