Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.os.linux.ubuntu > #197537

Re: systemd was Re: nautilus not working/wireless not responding either

From "Jonathan N. Little" <lws4art@gmail.com>
Newsgroups alt.os.linux.ubuntu
Subject Re: systemd was Re: nautilus not working/wireless not responding either
Date 2017-10-26 12:46 -0400
Organization LITTLE WORKS STUDIO
Message-ID <ost3hj$s8v$1@dont-email.me> (permalink)
References (13 earlier) <slrnou1is6.jir.BitTwister@wb.home.test> <6dednQH9XdaBSX3EnZ2dnUU7-W2dnZ2d@giganews.com> <f54h99Ffor4U1@mid.individual.net> <slrnouqc3d.jcr.BitTwister@wb.home.test> <f5c5g4F8u30U1@mid.individual.net>

Show all headers | View raw


fred flintstone wrote:
> cd /etc/dhcp/dhclient-exit-hooks.d/
>
> Does this archictecture change between our two systems? Mine seems to
> have an intermediary dhcp directory.
>
> $ chmod +x 2.env.sh
> chmod: changing permissions of '2.env.sh': Operation not permitted

This is because you to not have write permissions in this directory. 
Remember you moved from your profile /home/fred (where you can write 
stuff) to /etc/dhcp/dhclient-exit-hooks.d/ (where you should not be able 
to write stuff). This is intentional in Linux for security. To 
write|edit|delete stuff *not* in your own profile requires 2 things:

1) You be a member of sudoers
2) You elevate your privileges to root, such as using sudo.

You should have entered:

sudo chmod +x 2.env.sh

>
> If I had typed
>
> sudo -i
>
> before this, would this have been permitted?

Yes.

>
> $ sudo chmod +x 2.env.sh
> $ ls -l
> total 16
> -rwxr-xr-x 1 root root    0 Oct 24 17:48 1.env.sh
> -rwxr-xr-x 1 root root  891 Oct 25 10:59 2.env.sh

With elevated permissions you are now able to change file's permissions.

> lrwxrwxrwx 1 root root    8 May 25 05:37 debug -> ../debug
> -rw-r--r-- 1 root root 1756 Apr 13  2016 rfc3442-classless-routes
> -rw-r--r-- 1 root root 1117 Jan 12  2017 timesyncd
> -rwxr-xr-x 1 root root 1025 Nov 24  2015 zzz_avahi-autoipd
> $ 2.env.sh
> 2.env.sh: command not found


Okay, this happens because in Linux unlike Windows the *current* 
directory is *not* in your path. This is intentional again for security 
reasons. It is to prevent a "custom" command to override the default 
command simply be placing the custom executable|script in the current 
working directory. If you are going to run a script not on the path you 
must either use the absolute path or the relative path to the executable.

So in your situation since you were in the same directory as the script 
you been successful if you used either the absolute or relative path:

/etc/dhcp/dhclient-exit-hooks.d/2.env.sh

or

./2.env.sh

"./" dot slash means current directory.

>
> Question: why do I chmod +x this script?

Because in Linux what allows a script to run is determined by its 
executable bit and not like Windows that uses a part of the filename, 
i.e., "file extension", to tell the OS "this is executable".  It is 
something that throws ex-Windows users new to Linux. The ".sh" really 
mean nothing to Linux.

Example in Linux:

echo -e "ls -ls\necho 'hello world, I did a listing'" > foobar
chmod +x foobar
./foobar

The 3 steps will create a script, make it executable , then run it and 
it will work.

Example in Windows command window:

echo dir > foobar
echo echo hello world, I did a listing >> foobar
foobar

The 4 steps will not work and results in an error:

'foobar' is not recognized as an internal or external command,
operable program or batch file.

But change the name to add extension:

ren foobar foobar.bat
foobar

Now success!

HTH

-- 
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Back to alt.os.linux.ubuntu | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-09-24 12:36 -0700
  Re: nautilus not working/wireless not responding either "Jonathan N. Little" <lws4art@gmail.com> - 2017-09-24 15:46 -0400
    Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-09-29 14:26 -0700
    Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-10-04 19:40 -0700
      Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-05 05:03 +0000
        Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-10-07 15:49 -0700
          Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-07 23:24 +0000
        Re: systemd was Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-10 23:22 +0000
          Re: systemd was Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-10-10 20:32 -0700
            Re: systemd was Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-11 04:52 +0000
              Re: systemd was Re: nautilus not working/wireless not responding either Melzzzzz <Melzzzzz@zzzzz.com> - 2017-10-11 05:00 +0000
              Re: systemd was Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-10-12 16:09 -0700
                Re: systemd was Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-13 03:06 +0000
                Re: systemd was Re: nautilus not working/wireless not responding either "Jonathan N. Little" <lws4art@gmail.com> - 2017-10-13 00:33 -0400
                Re: systemd was Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-13 05:00 +0000
                Re: systemd was Re: nautilus not working/wireless not responding either "Jonathan N. Little" <lws4art@gmail.com> - 2017-10-13 09:31 -0400
                Re: systemd was Re: nautilus not working/wireless not responding either "Jonathan N. Little" <lws4art@gmail.com> - 2017-10-13 09:32 -0400
                Re: systemd was Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-13 14:19 +0000
                Re: systemd was Re: nautilus not working/wireless not responding either Marek Novotny <marek.novotny@marspolar.com> - 2017-10-13 09:56 -0500
                Re: systemd was Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-10-22 14:35 -0700
                Re: systemd was Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-22 23:57 +0000
                Re: systemd was Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-10-25 12:03 -0700
                Re: systemd was Re: nautilus not working/wireless not responding either "Jonathan N. Little" <lws4art@gmail.com> - 2017-10-26 12:46 -0400
                Re: systemd was Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-26 23:54 +0000
                Re: systemd was Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-10-31 17:28 -0700
                Re: systemd was Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-11-01 01:36 +0000
                Re: systemd was Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-11-06 12:35 -0800
                [OT] Re: systemd was Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-27 00:23 +0000
                Re: systemd was Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-10-25 16:13 -0700
                Re: systemd was Re: nautilus not working/wireless not responding either "Jonathan N. Little" <lws4art@gmail.com> - 2017-10-13 11:42 -0400
                Re: systemd was Re: nautilus not working/wireless not responding either "Jonathan N. Little" <lws4art@gmail.com> - 2017-10-13 11:45 -0400
                Re: systemd was Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-10-13 17:03 -0700
                Re: systemd was Re: nautilus not working/wireless not responding either "Jonathan N. Little" <lws4art@gmail.com> - 2017-10-13 20:25 -0400
                Re: systemd was Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-14 01:45 +0000
        Re: systemd was Re: nautilus not working/wireless not responding either Mike Easter <MikeE@ster.invalid> - 2017-10-10 16:34 -0700
          Re: systemd was Re: nautilus not working/wireless not responding either Mike Easter <MikeE@ster.invalid> - 2017-10-10 16:41 -0700
        Re: nautilus not working/wireless not responding either Mike Easter <MikeE@ster.invalid> - 2017-10-11 10:28 -0700
          [OT] Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-11 17:50 +0000

csiph-web