- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Own-build rpm runs the uninstall script after ...
Operating System - Linux
1748017
Members
3524
Online
108757
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-09-2004 09:59 PM
тАО05-09-2004 09:59 PM
Own-build rpm runs the uninstall script after installation
Help!!
I have a simple monitoring tool I've just converted from SCO to Linux and am trying to wrap this in an RPM, after spending many hours trying to work out why the RPM was not adding the cronjob or installing the service, I find it's actually running the uninstall script after installation, which kind of seems pointless, when installing, it still tries to run the uninstall script too, but fails as the cronjobs no longer exist for the user!
The spec file is below, I run an rpm -ba sysinf.spec to create the rpm file.
Summary: Provides automated system monitoring
Name: sysinf
Version: 1.3
Release: 18
Copyright: Alchemetrics Ltd.
Group: Alchemetrics/Infrastructure
%description
Alchemetrics tool to provide automated monitoring on all systems. Works by uploading data to a MySQL database.
%preun
/sbin/insserv -r /etc/init.d/sysinf
/usr/sbin/crontab -u sysinf -r
%post
/sbin/insserv -d /etc/init.d/sysinf
/usr/bin/crontab -u sysinf -r
/usr/bin/crontab -u sysinf - < */5 * * * * /usr/local/bin/sysinf sysinf
END
%files
/usr/local/bin/sysinf
/etc/init.d/sysinf
I have a simple monitoring tool I've just converted from SCO to Linux and am trying to wrap this in an RPM, after spending many hours trying to work out why the RPM was not adding the cronjob or installing the service, I find it's actually running the uninstall script after installation, which kind of seems pointless, when installing, it still tries to run the uninstall script too, but fails as the cronjobs no longer exist for the user!
The spec file is below, I run an rpm -ba sysinf.spec to create the rpm file.
Summary: Provides automated system monitoring
Name: sysinf
Version: 1.3
Release: 18
Copyright: Alchemetrics Ltd.
Group: Alchemetrics/Infrastructure
%description
Alchemetrics tool to provide automated monitoring on all systems. Works by uploading data to a MySQL database.
%preun
/sbin/insserv -r /etc/init.d/sysinf
/usr/sbin/crontab -u sysinf -r
%post
/sbin/insserv -d /etc/init.d/sysinf
/usr/bin/crontab -u sysinf -r
/usr/bin/crontab -u sysinf - <
END
%files
/usr/local/bin/sysinf
/etc/init.d/sysinf
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2004 11:24 AM
тАО05-10-2004 11:24 AM
Re: Own-build rpm runs the uninstall script after installation
In your %post, you have:
%post
/sbin/insserv -d /etc/init.d/sysinf
/usr/bin/crontab -u sysinf -r
/usr/bin/crontab -u sysinf - < */5 * * * * /usr/local/bin/sysinf sysinf
END
Ok. You're removing the crontab for user 'sysinf', then using a here-document to try to create a new one.
Try twho things.
one: remove that 'crontab -u sysinf -r' from here, add a crontab manually, and reinstall the package.
two: use a simple 'echo */5 * * * * /usr/local/bin/sysinf sysinf' | crontab -e -u sysinf' instead.
See if either of these resolve you issue.
%post
/sbin/insserv -d /etc/init.d/sysinf
/usr/bin/crontab -u sysinf -r
/usr/bin/crontab -u sysinf - <
END
Ok. You're removing the crontab for user 'sysinf', then using a here-document to try to create a new one.
Try twho things.
one: remove that 'crontab -u sysinf -r' from here, add a crontab manually, and reinstall the package.
two: use a simple 'echo */5 * * * * /usr/local/bin/sysinf sysinf' | crontab -e -u sysinf' instead.
See if either of these resolve you issue.
One long-haired git at your service...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2004 08:33 PM
тАО05-10-2004 08:33 PM
Re: Own-build rpm runs the uninstall script after installation
Well, that was even worse:
Vim: Error reading input, exiting... 0,0-1 All
^[[>0;136;0cVim: Finished.
/usr/bin/crontab: "/usr/bin/vi" exited with status 1
execution of sysinf-1.3-19 script failed, exit status 1
Which makes sense, crontab -e won't work as there's no terminal assigned to input!
However, after putting the modification back again, it's now working as I'd expect...
How very strange, I must have made a silly typo or something!
Vim: Error reading input, exiting... 0,0-1 All
^[[>0;136;0cVim: Finished.
/usr/bin/crontab: "/usr/bin/vi" exited with status 1
execution of sysinf-1.3-19 script failed, exit status 1
Which makes sense, crontab -e won't work as there's no terminal assigned to input!
However, after putting the modification back again, it's now working as I'd expect...
How very strange, I must have made a silly typo or something!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-13-2004 08:54 PM
тАО09-13-2004 08:54 PM
Re: Own-build rpm runs the uninstall script after installation
Strangely by re-writing out the contents of the spec file I got it working, thanks for your help though!
I must have had a dodgy character in there somewhere!
I must have had a dodgy character in there somewhere!
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP