Software :: Best Way To Code Rpm Pre / Post Scripts
Mar 23, 2010
I'm having a few problems coding a post install script for my custom RPM package. I'm putting the script directly in the %post section of the spec files. For example if I wanted to add a user after the package is installed I would add the following code. The problem is capturing the output of the commands which should be stored in the variable.
The problem seems to be that myuser is always null even if bob exists in /etc/passwd.What's wrong with this code and should I use an external script instead?
I think what i need to do is update the certifcate for the apache2, but I'm not sure how to do this, where to put it, and then which of the thousand apache config lines needs to be changed
I am trying to connect to the web interface found at [URL] using curl. This first requires login information to be entered at [URL], but I am having an issue with the login process. I am trying to submit the following form via POST:
Code: <form action="j_security_check" method="post" id="login_form" name="login_form"> <center> <table style="background: #cac1cf;FONT-SIZE: 12px;"> <tr> <td align="center" colspan="2">Please enter your username and password:</td> </tr> <tr> <td align="right">Username</td> <td> <input name="j_username" style="width: 250px" id="j_username" type="text"/> </td> </tr> <tr> <td align="right">Password</td> <td> <input style="width: 250px" name="j_password" id="j_password" type="password"/> </td> </tr> <tr> <td colspan="2" align="center"> <input value="Enter" name="enter" type="submit"/> <input value="Clear" name="Clear" type="reset"/> </td> </tr> </table> </center> </form> The command that I am using for this is the following:
Code: curl -c cookies -b cookies -L -d "j_username=user%40domain.com&j_password=pass" [URL] The command is properly formatted as far as I can tell. I tested it with another website using a similar authentication scheme using different POST variables specific to the form and it worked fine.
When I run the above command with the -v tag, it reveals this: Code: * Connected to lcl.uniroma1.it (151.100.4.74) port 80 (#0) > POST /sso/j_security_check HTTP/1.1 > User-Agent: curl/7.21.0 (i686-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18 > Host: lcl.uniroma1.it > Accept: */* > Content-Length: 44 > Content-Type: application/x-www-form-urlencoded > } [data not shown] < HTTP/1.1 408 The time allowed for the login process has been exceeded. If you wish to continue you must either click back twice and re-click the link you requested or close and re-open your browser < Date: Sat, 29 Jan 2011 15:26:41 GMT < Server: Apache-Coyote/1.1 < Content-Type: text/html;charset=utf-8 < Content-Length: 1554 < Connection: close < { [data not shown] 103 1554 100 1554 0 52 5081 170 --:--:-- --:--:-- --:--:-- 10223* Closing connection #0
I cannot tell why the login timeout is expired when I try to do this, and my investigation toward this end has been fruitless. I saw a brief snippet on Google that vaguely suggested that the underscores in the domain name were at fault, but replacing these with their encoded counterparts did nothing to resolve the issue (that, and underscores should be fine when sent unencoded according to the standards). I have extensively perused the man pages and have come up with nothing to adequately explain this behavior. I also talked to a friend who has worked with curl in his line of work, but he mostly has experience in the context of PHP and has not dealt with this issue before. I am running GNU/Linux 2.6.35-22-generic-pae.
For some odd reason, I cannot post on the ubuntu forum and the LinuxMint forum. Yea, I know.... the irony... I am using Mozilla and have tried Chromium, but that did not fix my problem. When I click on "submit" to post a thread, the page will just say "loading..." and nothing happens for a really long time. Does anyone know what is up? I tried posting on one other forum that I go to often and it seems to work out fine. I haven't tried any other forums though.
i think this is not the right place for this post, but i can not figure out how to post a bug. i am talking about the permissions of: /tmp/orbit-root. please don't tell me now "don't" log in as root if you once login as user root from the login screen the permissions of /tmp/orbit-root are set to: drwx root but if log out the permissions are not set back / or the entry will be deleted. this will end for the next login as a normal user that you will get a bulp of error messages. easy to reproduce. this is not a feature - it's a bug.
I've been using ubuntu almost exclusively for more than a year. I am now running 10.04. I was trying via launchpad to post some bugs I've run into in Ubuntu. None of the bugs relate directly to a certain process. And if they do, I have no idea how to find out their PIDs.
I have a data file with the following format 0 i j # # # # with other random lines of text to be filtered out.The following script works when there aren't many #s, but it shuffles long lists of data.
Got a gigabyte ga-ma78g-ds3h mobo with an amd athlon dual core 5050e processor that occasionally causes this warning at post. Removed and replaced the processor but still occurs, possibly slightly less frequently so it might just be a bent pin and this will be tried again. However i am curious as to whether others have seen the warning in case it is software although i am assuming it must be hardware. I guess it could be a bios bug, the bios was updated about a year ago. Log files and system monitor confirm the missing cpu.
I can't, for the life of me see a way to attach an image to a forum post. Maybe it's time for a nap, it has been a very very long day. I've seen attached images on this forum in the past.
I have a problem with gwibber. It has emerged randomly for no apparent reason as I have not changed any settings. All of a sudden, when updating my status on Facebook, and I click send, gwibber appears to work for a while, and then just nothing happens. My status does not get updated. It works fine with Twitter. It's only facebook. I have checked my application settings in Facebook and gwibber has full permission to post.#
I tried setting up the account again in gwibber, but this just opened a can of worms, because I had to reinstall gwibber and delete all of the config files in order to reinstate my facebook account, (see URL...)due to a bug in gwibber, which was a pain.
I can not post to Ubuntu Server section, I choose this section to post about this mysql general problem. I just checking mysql and trying to execute
[Code]...
you know what's the general or the common output? I've not found it yet through google until now. This is my result;
[code]...
but i realize, i never create debian-sys-maint and again, i never create root user until 3 times. Is this some error or missconcept or what? when if we do removing those users, and create 1 user (example: root) is it safe?
I have a problem with installing ubuntu 11.04 I get this message: Code: Hspell: can't open /usr/share/hspell/Hebrew.wgz.sizes It's get stuck with the updating time from internet servers process but I can't find a way to report it to launchpad.
I noticed a few days ago that my asus g60vx-rbbx05 beeps. It doesn't however while the POST. It never beeped during POST so I guess not beeping is the way it tells me it is alright. It beeps while the software is working, after it is booted. I use fedora 14. I have no idea why though because it seems to do it randomly. I first thought that it did it when the CPU was running at high frequencies but that's not the case. It even beeped while I was writing this post and I don't have anything else running except Firefox.
I have replaced my motherboard, cpu, ram with a retailed 'bundle' of components. When I power up, the cpu fans spins and i can feel my hard drive vibrating but There is no post beep. I could connect one of two four pin pwr2 leads to a motherboard; the first has yellow and black leads, the second, red purple black and yellow. Have you any ideas on my next move?
I created a local user acount and tested FTP. This allows me to post files to this directory using filezilla. I then created a webftpaccount and set the home directory to /var/www/html. Here are the permission to this directory using ls -l drwxrwsr-x 6 webftpaccount webftpaccount 4096 Nov 23 10:32 htmlhere are the permission on the sub directories
drwxrwsr-x 2 webftpaccount ftp 4096 Nov 14 07:37 myfinanceguard drwxrwsr-x 2 webftpaccount root 4096 Nov 14 07:37 mylawguard drwxrwsr-x 2 webftpaccount root 4096 Nov 14 07:36 xpiinc
I can log into the webftpaccount using filezilla client and it lists all the directories.It will not allow me to write a file into the html directory or any of the sub directories.Can someone help me set appropriate permissions on these directories so that I can get this working? I need to get FTP working so I set up dreamwaever FTP tlich and maintain sites.
I have some free space (not partitioned) on my disk drive. I have not configured LVM during installation.Is it possible to modify some of the existing partitions to be a member of LVM?
I have been searching EVERYWHERE for a solution to my problem, I have been sent to the red-bean "answer" so many times I think I know it word by word.Here is my problem, I run a WHM/cPanel server and want to make a repository (/home/<user>/svn) update a working copy (/home/<user>/public_html/dev) to work on a dev. subdomain on each site we have.I have the the SVN part working but can not get anything about the post commit to work. I even simplified it to the point that all the /hooks/post-commit file contained was.
There are a few web databases (also including my own php-based pdf manipulator), where I need to fill a html form, and upload file attachments.
About one year ago, these sites stopped to work correctly, when using Firefox (but they work from Internet Explorer). The problem concerns file upload. Other users here also experienced this, and no firefox update corrected the problem in the past year (I am using Firefox 3.6.9 now, and the problem is still there).
When debugging my pdf creator, I found that the attachment-type of any file upload made by firefox is "text/html", irrespectively of what is the type of the uploaded file. Whilst files uploaded by IE have the correct attachment-type.
I've been pulling my hair out trying to get wget to post data to a webpage to automatically download some files. I've tried many methods of syntax, but wget always downloads the html for the login page. A snippet of code I found in the login html page is below. Some of the characters are japanese, because it's a japanese website.
I've got a CGI that I'm trying to debug. Apache gives me an ambiguous 500 error; it would be nice to see the raw output via the shell. I've got the POST request w/headers as follows. What's the best way to troubleshoot this?
POST /cgi/packBoxes.cgi HTTP/1.1 Host: 70.87.60.214 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729) Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
I am trying to automate installs of Red Hat 5.5 x86. I have a FAT32 partition on my disk at /dev/sda1 that I want to mount to /cdrv folder of the installed OS and I use this line in the %post section for this:"mount -t vfat -o iocharset=utf8,umask=000 /dev/sda1 /cdrv" For some reason, this does not mount the partition.onfirm using "fdisk -l>>/post.log" that /dev/sda1 is FAT32 and is the Boot partition. I can create any folders or files using the %post section but just this mounting doesnt seem to work.
I suspect a few people will eventually run into this problem, and while it's easy to get around for the more experienced users (the ones that *should* be running -current), we all know that everyone isn't in that group