M
Moritz Reiter
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
I am new to Ruby and want to make a Ruby script for the network
configuration of my notebook as an exercise. Now I encountered a problem
which is pretty strange to me:
I want to invoke '/etc/init.d/networking restart' from within my Ruby
program. If I create a file with the line
%x{ /etc/init.d/networking restart }
it works like I would expect. The networking init script gets invoked
and correctly processed.
But if I do something like this:
- -->8--
class Netconf
def restart
puts %x{ /etc/init.d/networking restart }
end
end
netconf = Netconf.new
netconf.restart
- --8<--
I get some output from the init script but it doesn't seem to actually
do anything. It does not reconfigure my eth's in oppostion to the
behaviour described above if don't make the system call from within a
method.
I would be very glad if anyone could give me a hint or point me to some
documentation to enlighten me.
Best Regards,
- --
Moritz Reiter <[email protected]>
GPG key fingerprint:
https://luna.agrav.org/~mo/gpg/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFZI7awR2rA+A/LU4RAum0AJ9N3mnRAxGlFi1D3afeQbSa0l21nwCgimn3
RnvNFcgWi+OLcngGIOKO2jU=
=W+gv
-----END PGP SIGNATURE-----
Hash: SHA1
Hi all,
I am new to Ruby and want to make a Ruby script for the network
configuration of my notebook as an exercise. Now I encountered a problem
which is pretty strange to me:
I want to invoke '/etc/init.d/networking restart' from within my Ruby
program. If I create a file with the line
%x{ /etc/init.d/networking restart }
it works like I would expect. The networking init script gets invoked
and correctly processed.
But if I do something like this:
- -->8--
class Netconf
def restart
puts %x{ /etc/init.d/networking restart }
end
end
netconf = Netconf.new
netconf.restart
- --8<--
I get some output from the init script but it doesn't seem to actually
do anything. It does not reconfigure my eth's in oppostion to the
behaviour described above if don't make the system call from within a
method.
I would be very glad if anyone could give me a hint or point me to some
documentation to enlighten me.
Best Regards,
- --
Moritz Reiter <[email protected]>
GPG key fingerprint:
https://luna.agrav.org/~mo/gpg/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFZI7awR2rA+A/LU4RAum0AJ9N3mnRAxGlFi1D3afeQbSa0l21nwCgimn3
RnvNFcgWi+OLcngGIOKO2jU=
=W+gv
-----END PGP SIGNATURE-----