LinuxSysAdmin

Things I don't want to look for twice..

Monthly Archives: April 2014

deb package status

As I’m always forgetting the meaning on the letters from “dpkg –list”, here’s the meaning:

First character:

u: Unknown (an unknown state)
i: Install (marked for installation)
r: Remove (marked for removal)
p: Purge (marked for purging)
h: Hold
Second Character:

n: Not- The package is not installed
i: Inst – The package is successfully installed
c: Cfg-files – Configuration files are present
u: Unpacked- The package is stilled unpacked
f: Failed-cfg- Failed to remove configuration files
h: Half-inst- The package is only partially installed
W: trig-aWait
t: Trig-pend

Third Character:

R: Reinst-required The package must be installed.

This was taken from here.

Advertisements

changing PATH for Ansible and Ansible loops

So, I’ve had a problem with trying to run things as ansible and sudo. Of course, password was not required for any of my sudo commands, but I often get “command not found”. Clearly, after running “env” with ansible using sudo on a server, I noticed I was missing /usr/sbin and /sbin from my path, as opposed to root’s PATH with had both folders.

In my case, was a Debian init stript which relied on start-stop-daemon, which is in sbin, and I got the command not found error. Here is how you set it up in a playbook:

 - name: stop monit service
 shell: PATH=$PATH:/usr/sbin:/sbin sudo /etc/init.d/monit stop

Testing showed that:

ansible test-srv -s -m shell -a "PATH=$PATH:/usr/sbin:/sbin env"
test-srv | success | rc=0 >>
PATH=/home/ansible/ansible/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/sbin:/sbin

Today I also discovered loops. I had to run a bunch of commands on a lot of servers, searched a bit and found loops. So, if you need to run 5 commands on your servers on a single task from a playbook, do the following:

- name: multiple commands
  command: "{{item}}"
  with_items:
    - /path/to/command1
    - /path/to/command2
    - command3
    - command4
    - command5

Path requirement is for the case in which the specified command isn’t in user’s PATH by default and you should specify full path for the command itself.

incapable AT&T sysadmins

I’ve been trying for weeks to remove my provider’s external mail server IP address from AT&T’s blacklists as it’s affecting our business. Being a booking website, it’s hard not to be able to send booking confirmations and other stuff required for people to be able to complete a booking on our website. So we always get the NDR telling us we’re being rejected. I’ve tried looking for our IPs in they’re third party RBLs like SpamHaus or Symantec, with no luck. So our IP is in their own blacklist, not third-party.

Today, after about 3 weeks from when I first filled their form here, http://rbl.att.net/cgi-bin/rbl/block_admin.cgi I tried again. Both times, didn’t receive any confirmations by email, nothing, nada. This time I discovered they have some email address for requests based on what you filled in the form and I tried that. Hope this time their sysadmins will take it into consideration. Hopefully this time they’re not sleeping, not smoking weed or whatever the fuck they’re doing as they don’t seem to care about their customers and this time I have DKIM installed on both domains we’re using to send out emails. Hope it will count in their decision.

BTW, how can you blacklist an IP for a mail server for a booking company? As long as it’s not some open relay for everybody to send mail from, did they even checked the email? See what’s it about? ..or it’s just that when a client (or 2, 3) marks the mail as SPAM, AT&T adds the IP to their blacklist and never gets it out of it? Should we get a full C-class subnet to send emails from? B? Maybe customers should just switch to other services? Like Yahoo, with infinite storage, GMail, Outlook.com, install the webmail adblocker extension to remove unuseful crap (Ads) and they should have a clean interface. Also, tickets opened to them seem to have way better results at removing from blacklists as the results I’m having with AT&T.

Although I’ve been appointed by HR agencies to get hired at AT&T, I’m very glad I’ve turned down their offers. Hell no! (although, sleeping in the office and smoking weed all day seems like a nice treatment)