Tag Info

New answers tagged

0

If you set key-value pairs with the plugin "openvpn-plugin-auth-pam.so" like this: plugin /usr/lib/openvpn/openvpn-plugin-auth-pam.so "openvpn mykey myval login COMMONNAME" then it doesn't set PAM_USER (because it calls pam_start with user=NULL), maybe that's your problem?


1

For zfs, per the zfs man page, use zfs userspace filesystem to get a listing for all users on a file system, and use zfs get [-r] userused@user filesystem to get space used by a particular user on a filesystem. Use the -r option to zfs get ... to get user usage on all descendents of the filesystem, too. Be aware that this will return not just descendent ...


0

Expect is based on Tcl language, so you shouldn't use bash 'echo' - you should use 'puts' to print something on the screen: #!/usr/bin/expect -f set device "1.1.1.1" set user "testuser" spawn ssh $user@$device puts $device puts $user And you will got result like this: $ ./test.exp spawn ssh testuser@1.1.1.1 1.1.1.1 testuser


0

The error messages suggests you are running the command with an explicit interpreter, eg: bash ./testexpect.exp This will ignore the "#!" line. Whatever is launching the script needs to just name the file (or explicitly say expect ./testexpect.exp). If your #! line was bad you would have got /usr/bin/expect: bad interpreter: ...


0

Connect to mysqld using mysqladmin MySQL Documentation says about mysqladmin ping Check whether the server is available. The return status from mysqladmin is 0 if the server is running, 1 if it is not. This is 0 even in case of an error such as Access denied, because this means that the server is running but refused the connection, which is different ...


0

As @khaled said in the comment thread of your question, it'd be much more reliable to implement keepalived. It's not nearly as scary as you may think it is. keepalived will manage the floating IP, and you tell it to run a script in the event of a failover. Here's an article specifically on how to configure keepalived with mysql: ...


0

Assuming you will have sshkey auth for password less login for root user to the remote machine, you can run the following command - ssh remotemysql "if [ 'ps -efww | grep mysql| grep -v grep' ]; then echo "server is up" ; else echo "server is down"; fi" replace echo "server is down" with the a mysql start up script. say /etc/init.d/mysqld start


0

Checking is easy as this: mysql -e "select 1" || echo down You could replace the echo with an ssh command into root to start the service, but that seems a bit risky. It may have security implications. It may not be reliable. I would suggest that you should probably have some kind of proper cluster/failover software to do this. There is MySQL MMM, which we ...


0

It is better to use keychain in this case Debian/Ubuntu: apt-get install keychain RHEL/Fedora/CentOS yum install keychain Add in your .bashrc the following: eval `keychain --eval id_rsa`


2

I propose to put the command into a shell script and just give sudo rights for this script. Just make sure the users aren't allowed to edit it.


0

You can use the -L option for curl to have it follow redirects.



Top 50 recent answers are included