I need to alter a bunch of in-house developed .debs, mainly to remove some dependencies that are common to all those packages. So, my question is do I need to take the source for all of them, and recompile ? Or is there any another way to modify them ( opposed to making a package from scratch ) ? Am I being very off if I say I need to do a dpkg-deb --extract and --control, edit, and then --build ?
Mohit Chawla's questions
I think what I am trying to do can be achieved using bash scripts, but I could definitely use some help here ! Ok, here's the scenario:
I have a two-node MySQL cluster with Master-Master replication in place. Now, the application in question (SOGo) runs on those two nodes. At any given point of time, both instances of the application are supposed to read-from/write-to a single replica, to avoid duplicate entries, obviously.
So if instance A is writing to its local database, then B is also writing on that database, remotely. And vice-versa.
If A goes down, then I have to replace a configuration directive in B's SOGo instance to make it use its local database now. A simple sed statement and service restart does this.
After that, when A gets back again, then either I can instruct A to write to B's copy, or ask B to stop writing on its local copy, and instead write to A's copy.
So, to automate this procedure, what would be my best bet ?
I am not sure if this is just specific to my distro's packages or is a vbox limitation. So, any help would be appreciated.
Ok, so I have a network of VMs, with one VM acting as a NAT for the other VMs in the "internal" network. One of those VMs is running a DHCP & TFTP server, and I just need to boot other VMs off of this server, but all I get starting the VMs when booting from the network is "Fatal: Could not read from the boot medium ! System halted".
This is kinda killjoy since vbox is pretty easy to use and to experiment with, but I can't get around this error. Help ?
Well we have an in house server manager (like Webmin, only more specific), comprising of a bunch of C CGI programs and CGI Perl scripts, some of which require root privileges (adding system users, managing passwords, dealing with mail queues etc. ) to be executed.
Currently Apache works as a reverse proxy and passes requests to another web server (Xitami) that listens on localhost, running as root.
So my question is, that instead of running a web server as root (even if its on 127.0.0.1), is it any different from doing a setuid root on the specific cgi directories/programs/scripts that absolutely require root privileges to execute ? Or are both equally insecure ? What could be the best possible solution/practice in this scenario ?
Although I know the immediate solution to a problem I was facing yesterday (thanks to the folks over at IRC #puppet), I still don't understand how it solved the problem, or rather what's the fundamental difference between classes and defines in this particular scenario:
The original define, which was incorrect:
define srv($name,$enable="true",$ensure="running",$provider="runit",$hasstatus="true",$hasrestart="true"){
exec {"sleep 5": path=>"/usr/bin:/usr/sbin:/bin:/sbin", before=>Service["$name"],}
service{"$name":
enable=>$enable,
ensure=>$ensure,
provider=>$provider,
hasstatus=>$hasstatus,
hasrestart=>$hasrestart,
}
}
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate definition: Exec[sleep 5] is already defined in file /etc/puppet/modules/common/manifests/defines/srv.pp at line 4; cannot redefine at /etc/puppet/modules/common/manifests/defines/srv.pp:4 on node testing.abc.def.com
The correct define:
define srv($enable="true",$ensure="running",$provider="runit",$hasstatus="true",$hasrestart="true"){
exec {"sleep 5 for $name": command=>"sleep 5", path=>"/usr/bin:/usr/sbin:/bin:/sbin", before=>Service["$name"],}
service{"$name":
enable=>$enable,
ensure=>$ensure,
provider=>$provider,
hasstatus=>$hasstatus,
hasrestart=>$hasrestart,
}
}
So, why the error in the first case ? How am I duplicating a definition or in other words, if there was a single module using this define then would have the first define worked ? Maybe its the puppet terminology in the docs that has left me confused, but having written a ton of (working) modules and not understanding this sounds dangerous to me, hope I can get some clear answers.