Re: [PATCH] SysctlModule

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 21, 2008 at 09:55:40PM -0500, Luke Macken wrote:
> Does anyone have any interest in a sysctl module ?
> 
> This allows you to weak your minion's kernel parameters at runtime, ie:
> 
>     # func "*" call sysctl get net.ipv4.icmp_echo_ignore_broadcasts
>     ['1']
>     # func "*" call sysctl set net.ipv4.tcp_syncookies 1
>     ['net.ipv4.tcp_syncookies = 1']

[...]

> +    def __run(self, cmd):
> +        cmd = sub_process.Popen(cmd.split(), stdout=sub_process.PIPE,
> +                                stderr=sub_process.PIPE, shell=False)
> +        return [line for line in cmd.communicate()[0].strip().split('\n')]
> +
> +    def list(self):
> +        return self.__run("/sbin/sysctl -a")
> +
> +    def get(self, name):
> +        return self.__run("/sbin/sysctl -n %s" % name)
> +
> +    def set(self, name, value):
> +        return self.__run("/sbin/sysctl -w %s=%s" % (name, value))

Could we avoid joining data in order to split them later? I recently
went through a rather painful process of cleaning the
space/escape/shell metacharacter issues in one project, so my gut
feeling is it will bite us one day ...

-- 
Jan Pazdziora

_______________________________________________
Func-list mailing list
Func-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/func-list

[Index of Archives]     [Fedora Users]     [Linux Networking]     [Fedora Legacy List]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux