Results 1 to 9 of 9

Thread: Error Message After Trying to Edit /etc/default/rcS

  1. #1
    Join Date
    Jun 2014
    Beans
    295

    Error Message After Trying to Edit /etc/default/rcS

    I'm getting an error message after trying to edit /etc/default/rcS to set the time on my Ubuntu partition to local time.
    I've been following these instructions: https://askubuntu.com/questions/1693...f-on-dual-boot but for some reason I think I made a mistake. Could somebody help me?


    E325: ATTENTION
    Found a swap file by the name "/etc/default/.rcS.swp"
    owned by: root dated: Sun Feb 12 19:48:41 2017
    file name: /etc/default/rcS
    modified: YES
    user name: root host name: Ubuntu-Laptop
    process ID: 4424
    While opening file "/etc/default/rcS"
    dated: Fri Jan 20 17:57:36 2017

    (1) Another program may be editing the same file. If this is the case,
    be careful not to end up with two different instances of the same
    file when making changes. Quit, or continue with caution.
    (2) An edit session for this file crashed.
    If this is the case, use ":recover" or "vim -r /etc/default/rcS"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file "/etc/default/.rcS.swp"
    to avoid this message.
    Last edited by John_Patrick_Mason; February 19th, 2017 at 03:14 AM.

  2. #2
    Join Date
    Oct 2013
    Location
    Colorado
    Beans
    560
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Error Message After Trying to Edit /etc/default/rcS

    What is in the rcS file now? Does it look like it did when you tried to edit it? If so, delete the .rcS.swp file and try again.

  3. #3
    Join Date
    Jul 2007
    Location
    Magic City of the Plains
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Error Message After Trying to Edit /etc/default/rcS

    Which version of Ubuntu are you running?

  4. #4
    Join Date
    Jun 2014
    Beans
    295

    Re: Error Message After Trying to Edit /etc/default/rcS

    Quote Originally Posted by Keith_Helms View Post
    What is in the rcS file now?
    Code:
    #
    # /etc/default/rcS
    #
    # Default settings for the scripts in /etc/rcS.d/
    #
    # For information about these variables see the rcS(5) manual page.
    #
    # This file belongs to the "initscripts" package.
    
    # delete files in /tmp during boot older than x days.
    # '0' means always, -1 or 'infinite' disables the feature
    #TMPTIME=0
    
    # spawn sulogin during boot, continue normal boot if not used in 30 seconds
    #SULOGIN=no
    
    # do not allow users to log in until the boot has completed
    #DELAYLOGIN=no
    
    # be more verbose during the boot process
    #VERBOSE=no
    
    # automatically repair filesystems with inconsistencies during boot
    #FSCKFIX=no
    Do the contents of the file look normal to you?

    I also found three swap files under the same file name:

    Code:
    -rw-r--r--   1 root root 12288 Feb 12 20:05 .rcS.swn
    -rw-r--r--   1 root root 12288 Feb 12 19:51 .rcS.swo
    -rw-r--r--   1 root root 12288 Feb 12 19:48 .rcS.swp
    Can I safely delete the three files?

    Which version of Ubuntu are you running?
    16.04

  5. #5
    Join Date
    Oct 2013
    Location
    Colorado
    Beans
    560
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Error Message After Trying to Edit /etc/default/rcS

    Yes that looks like what's in the rcS file on my system. How did you get 3 swap files? Did you make multiple attempts to edit the file and they all crashed? You can delete them.

  6. #6
    Join Date
    Jun 2014
    Beans
    295

    Re: Error Message After Trying to Edit /etc/default/rcS

    How did you get 3 swap files?
    While I've come a long way with the command line, the truth is, I don't really have the skills to edit text files, yet. I was just trying to set the time on my Ubuntu partition to local time, so that next time, when I decide to boot into my Windows partition, I don't have to deal with a clock that's five hours ahead. I was really just looking for a quick online solution. I figured the keyboard commands would be the same with the less program, up/down arrow left/right arrow, guess I was wrong.

  7. #7
    Join Date
    Aug 2011
    Location
    52.5° N 6.4° E
    Beans
    6,820
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Error Message After Trying to Edit /etc/default/rcS

    It seems you tried editing the file with vim. vim makes a swap file for recovery if the editor crashes or is killed. Maybe you killed vim instead of properly saving and closing? To properly save a file and close vim, use :wq or ZZ. To close without saving changes, use :q!. I suggest you search for a vim quick reference card and, later maybe, the Vimbook. It's not an easy editor to learn, but when you get used to it, it's very good.

    Your /etc/default/rcS is empty, in the sense that all lines are commented out. This is how it should be by default on 16.04. No changes were ever saved. You can safely remove the swap files.

    On 16.04, changing /etc/default/rcS is no longer the right way to solve this time zone problem. This is, I believe, because of the change to systemd. See this thread: https://ubuntuforums.org/showthread.php?t=2321876

  8. #8
    Join Date
    Jul 2007
    Location
    Magic City of the Plains
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Error Message After Trying to Edit /etc/default/rcS

    @John_Patrick_Mason, you might find the nano editor a bit easier to use.

    https://help.ubuntu.com/community/Nano

  9. #9
    Join Date
    Jun 2014
    Beans
    295

    Re: Error Message After Trying to Edit /etc/default/rcS

    On 16.04, changing /etc/default/rcS is no longer the right way to solve this time zone problem. This is, I believe, because of the change to systemd. See this thread:
    You're right. The link you provided solved the problem. I also deleted the swap files as suggested by others, which got rid of the error issue. Thanks a bunch.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •