Get PGKBUILD to modify local files... best way to do it? [SOLVED]

I'm writing a PKGBUILD that will simply place a script in /etc/cron.hourly but I also need to have both /etc/rc.local and /etc/rc.local.shutdown run the script (e.g./etc/cron.d/sync-monitorix.sh).  I don't know how to go about modifying these two files via the PKGBUILD.  Suggestions are welcomed.
pkgname=monitorix-tmpfs
pkgver=1.0
pkgrel=1
pkgdesc='Simple script to allow monitorix to run in tmpfs and sync data back to your hdd.'
arch=(any)
license=(GPL)
depends=(rsync monitorix)
source=(sync-monitorix.sh)
md5sums=(64573a0f7452b2f68cbd69ba86106d6b)
build() {
install -D sync-monitorix.sh $pkgdir/etc/cron.hourly/sync-monitorix.sh
Last edited by graysky (2010-01-30 01:23:19)

I wouldn't want a PKGBUILD to do that to my /etc/rc.local and /etc/rc.local.shutdown files. Those are my files and PKGBUILDs shouldn't be tampering with them. You'd have to parse them to know where to put your stuff. I don't know if you're even entitled to assume they're bash files (I forget right now whether they're sourced or executed---if the latter they needn't be bash files, right? though I grant they're overwhelmingly likely to be so).
Are you sure you can't do what you want with an /etc/rc.d/your_daemon? If the timing of when daemons start and stop isn't quite right, have a look at the "hooks" in /etc/rc.d/functions. I'm not sure which version of initscripts this shows up in---perhaps it's already in [core], perhaps still in [testing], perhaps only in the initscripts git repository. I haven't kept track. But it's very nice functionality for registering functions to be run at other times than the etc/rc.d/daemons run.
Or, just write a message on install telling users what they need to do to their /etc/rc.local files. And put it in the manpage/docs.

Similar Messages

  • How to get access to the local file system when running with Web Start

    I'm trying to create a JavaFX app that reads and writes image files to the local file system. Unfortunately, when I run it using the JNLP file that NetBeans generates, I get access permission errors when I try to create an Image object from a .png file.
    Is there any way to make this work in Netbeans? I assume I need to sign the jar or something? I tried turning "Enable Web Start" on in the application settings, and "self-sign by generated key", but that made it so the app wouldn't launch at all using the JNLP file.

    Same as usual as with any other web start app : sign the app or modify the policies of the local JRE. Better sign the app with a temp certificate.
    As for the 2nd error (signed app does not launch), I have no idea as I haven't tried using JWS with FX 2.0 yet. Try to activate console and loggin in Java's control panel options (in W7, JWS logs are in c:\users\<userid>\appdata\LocalLow\Sun\Java\Deployment\log) and see if anything appear here.
    Anyway JWS errors are notoriously not easy to figure out and the whole technology in itself is temperamental. Find the tool named JaNeLA on the web it will help you analyze syntax error in your JNLP (though it is not aware of the new syntax introduced for FX 2.0 and may produce lots of errors on those) and head to the JWS forum (Java Web Start & JNLP Andrew Thompson who dwells over there is the author of JaNeLA).

  • My father has just bought an IPOD. He wants to use my PC to get onto Itunes what is the best way to set this up.

    My father has  just bought an ipod classic and he wants to use my PC to download from I tunes. He is 88 and does not have one of his own.
    I have a number of questions: What is the best way for me to set up my computer for to allow him to do this.
    Would he always have to use my PC once he is set up. Can he download from elsewhere?
    Can I sync his IPOD into my I tunes account ( Is this even legal).
    Thanks for any advice.

    Orca Sn10 wrote:
    Thanks for your help. How do I do it with the iTunes on the PC. All my music is on an external hard drive and not in iTunes
    Thanks in advance
    Nick
    Nick,
    You will need a Windows PC with iTunes running and a working copy of Windows Media Player available on the machine.  (iTunes calls WMP for the conversion from WMA).  Then just drag the WMA file(s) into the iTunes Music window.
    iTunes will detect it and give you the dialog shown below, to which you choose "Convert."  iTunes will create a new version in the format/bitrate set in your Import preferences (MP3 in my example below), and immediately add it to your iTunes library.
    The WMA original will be left in place, so you can delete it if you have no other need for it.

  • Unzipping ZIP file - Best way

    Hi,
    I found many ways to unzip a ZIP archive,
    but which is the best way in term of performance ?
    I found some examples doing :
    ZipFile zipFile = new ZipFile( file ) ;
    Enumeration entries = zipFile.entries() ;
    while( entries.hasMoreElements() ) {
    ZipEntry entry = ( ZipEntry )entries.nextElement() ;
    // extract entry
    Others :
                   ZipEntry zipentry;
                   zipinputstream =
    new ZipInputStream(
    new FileInputStream(zipFile));
                   zipentry = zipinputstream.getNextEntry();
                   while (zipentry != null) {
    // extract entry
    zipentry = zipinputstream.getNextEntry();
    For extracting the entries I saw examples using BufferedInputStream and BufferedOutputStream
                             BufferedInputStream is =
                                  new BufferedInputStream(zipFile.getInputStream(entry));
                             int currentByte;
                             // establish buffer for writing file
                             byte data[] = new byte[1024];
                             // write the current file to disk
                             FileOutputStream fos = new FileOutputStream(destFile);
                             BufferedOutputStream dest =
                                  new BufferedOutputStream(fos, 1024);
                             // read and write until last byte is encountered
                             while ((currentByte = is.read(data, 0, 1024)) != -1) {
                                  dest.write(data, 0, currentByte);
                             dest.flush();
                             dest.close();
                             is.close();
    others using ZipInputStream and FileOutputStream :
    zipinputstream =
    new ZipInputStream(
    new FileInputStream(zipFile));
                        int n;
                        FileOutputStream fileoutputstream;
                        File newFile = new File(entryName);
                        String directory = newFile.getParent();
                        if (directory == null) {
                             if (newFile.isDirectory())
                                  break;
                        fileoutputstream =
                             new FileOutputStream(destinationname + entryName);
                        while ((n = zipinputstream.read(buf, 0, 1024)) > -1)
                             fileoutputstream.write(buf, 0, n);
                        fileoutputstream.close();
                        zipinputstream.closeEntry();
    Can u tell me which solution to use for looping through the files (by this Enumertion or by checking nextEntry is null ?)
    And for the extracting (use of BufferedInp. BufferedOutp. or ZipInputStream and FileOutputStream?) in term of performance
    Thank u for any tips
    Message was edited by:
    matt.webdev
    Message was edited by:
    matt.webdev
    Message was edited by:
    matt.webdev

    Hi there,
    Pl see code below. For example, create a file named "interest"on your c:\test\interest in notepad with your recordkey line info.
    recordKey     dollarAmount     interestRate     years
    1234          50          3          4          
    5678          60          4          5
    9876          70          5          6
    8765          80          6          7
    program below extracts recordKey line info if available in file.
    import java.io.*;
    public class SearchString
         String message = "9999";
         public static void main(String args[])
              SearchString ss = new SearchString();
              ss.searchFile("1234");
         public String searchFile(String sRecordKey)
              try
                   BufferedReader br = new BufferedReader(new FileReader("c:/test/interest.txt"));
                   String str = "";
                   while((str = br.readLine()) != null)
                             // passing a specific recordKey to search
                             if (str.indexOf("5678") != -1)
                                       System.out.println(str);
                                       message = str;
              catch (IOException e)
                   System.out.println("Could Not Search File");
              return message;

  • My 'start up drive' is almost full, and running slow.  I transferred all my music to an external drive, but still getting messages.  What is the best way to get rid of unneeded files.

    I am deleting or burning to CD photos I dont use regularly.  What else can I do?
    Does a full hard drive and slow machine warrent upgrading to a new one?

    I have 13 GB free out of 250GB
    That's tight. Rule of thumb for a start up drive - the one inside the Macbook - is to have atleast 15% free at all times.
    For getting rid of unnecessary stuff off the internal drive, I suggest you try Omni Disk Sweeper. It will give you a complete inventory of your drive, and purge what you ask it to delete. But be patient when it runs, give it time to do a full sweep.
    It's the second one on this page: http://www.omnigroup.com/more
    Hard drives are not that expensive. If I were you I would invest in another external drive for your library.

  • Partial row at end of file - best way to handle?

    Hi,
    I have a file where there is a partial row at the end. It doesn't cause an error, but I get a "partial row" warning during execution.
    What do most people do with these partial rows? Do they just ignore them as long as they don't cause errors? Or is it better to handle the partial row with a conditional split, for example?
    Just wondering what other people's thoughts on this are. I tend to be of the "get rid of it" camp, but maybe that's overkill? Just looking for opinions, best practices.
    Thanks

     sadie519590 wrote:
    It's only the last row.
    If you have partial rows in the middle of the file, this causes an error (unless you're ignoring errors). But SSIS ignores the partial row at the very end without any special error handling.
    Then you can leave it.  No harm, no foul.  Why is the last row incomplete though?  Can it be fixed at the source?

  • Skype getting connected..what is the best way to set up

    I have wireless laptops using my verizon fios internet. I have used Skype for chatting with family in military overseas..i started having a lot of problems with staying connected as time went on..what is a good setting for incoming and outgoing options for skype? I have had it set on automatically detect, but I do not want to compromise my security putting in settings I am not sure about.  I use Windows defense for firewall and I have Norton Internet Security 2010..if anyone has a good suggestion or have had success please let me know.
    I have Windows Vista 64bit, lots of speed and memory..don't know if i need any software updates? like video/audio? Seems like since I updated to skype 4.0 that it started..i tried uninstalling and tried several older versions..no good.
    I have had someone breach my security..and i do not want to just try messing with firewall settings, etc, unless someone really knows what they are talking about.
    Thanks
    Tc

    tc13rn wrote:
    I have wireless laptops using my verizon fios internet. I have used Skype for chatting with family in military overseas..i started having a lot of problems with staying connected as time went on..what is a good setting for incoming and outgoing options for skype? I have had it set on automatically detect, but I do not want to compromise my security putting in settings I am not sure about.  I use Windows defense for firewall and I have Norton Internet Security 2010..if anyone has a good suggestion or have had success please let me know.
    I have Windows Vista 64bit, lots of speed and memory..don't know if i need any software updates? like video/audio? Seems like since I updated to skype 4.0 that it started..i tried uninstalling and tried several older versions..no good.
    I have had someone breach my security..and i do not want to just try messing with firewall settings, etc, unless someone really knows what they are talking about.
    Thanks
    Tc
    Skype 4.0 was garbage, I could net get it to stay up on my windos 2003 server so finally backed out to 3.17.  However the latest one appears to be stable - 4.2.0.169 and I have now upgraded the server, the server has a vtech usb skype phone with a remote, skype on 1 line and pots or magicjack on the other.
    I have no special settings, just let it install.  Is running on xp, wni73 2bit and 64 bit and w2k3 server
    Admittedly my connections are all hard wired.

  • How to get homedirectory of local file system?

    how to get home directory of local file system?
    What code i have to write?

    String homeDirectory = System.getProperty("user.home");

  • What's the best way to merge, restore or reconstruct iPhoto and Aperture libraries to resolve images that are not found/offline?

    Hey there, Apple Support Communities.
    To start, I'm working on a MBP Retina 15" with a 2.3GHz i7 processor and 16 GB of RAM.  10GB free on a 256GB SS HD.  Attached are two external HDs - one 1TB Western Digital portable drive from 2011, one 2TB Porsche LaCie non-portable drive from 2013; both connected via USB.  All photo libraries in question are on the external drives.
    I have Aperture 3.5.1 and iPhoto 9.5.1.  I prefer to work in Aperture.
    The Issue(s)
    Over the years, I have accumulated a number of iPhoto libraries and Aperture libraries.  At one point, I thought my WD drive was dying so I purchased the LaCie and copied all libraries over the the LaCie drive.  (Turns out, there's probably an issue with my USB port reading drives, because I can once again see the WD drive and occasionally I can't see the LaCie drive.)
    So now I have old version of some libraries on the WD drive, and new versions on the LaCie drive.
    When I was moving things, I ran the software Gemini to de-dupe my iPhoto libraries.  Not sure what effect that may have had on my issues.
    In my main Aperture library and in some iPhoto libraries, I get the image-not-found badge or exclamation point.  I've dug through the hidden Masters folders in various libraries to find the original image.  In some cases, I have been able to find the original image, sometimes in a different version of the iPhoto library.
    My Question(s)
    1.  For Aperture libraries that have missing originals, is there some magical way to find them, or have they just disappeared into the oblivion?
    2.  For iPhoto libraries that have missing originals and I have found the original in another iPhoto library, what is the best way to proceed?
    3.  Are there quirks to merging iPhoto and Aperture libraries (by using the Import->Library) feature that I should be aware of?
    TL;DR: Too many iPhoto and Aperture libraries, and not all the original pictures can be found by the libraries anymore, though some originals still do exist in other libraries.  Steps/process to fix?
    Thank you!  Let me know if you need add'l info to offer advice.
    With appreciation,
    Christie

    That will not be an easy task, Christie.
    I am afraid, your cleaning session with Gemini may have actually removed originals. I have never used this duplicate finder tool, but other posters here reported problems. Gemini seems to replace duplicate original files in photo libraries by links, and this way, deleting images can cause the references for other images to break. And Aperture does not follow symbolic links - at least, I could never get it to find original files this way, when I experimented with this.
    1.  For Aperture libraries that have missing originals, is there some magical way to find them, or have they just disappeared into the oblivion?
    You have to find the originals yourself. If you can find them or restore them from a backup, Aperture can reconnect them. The reconnect panel can show you, where the originals are supposed to be, so youcan see the filename and make a Spotlight search.
    For iPhoto libraries that have missing originals and I have found the original in another iPhoto library, what is the best way to proceed?
    Make a copy of the missing original you found in a folder outside the iPhoto library. You can either open the iPhoto library in Aperture and use "File > Locate Referenced file" to reconnect the originals, or simply reimport them. Then Lift&Stamp all adjustments and metadata to the reimported version.
    See this manual page on how to reconnect originals:  Aperture 3 User Manual: Working with Referenced Images  (the paragraph:  Reconnecting Missing or Offline Referenced Images)
    Are there quirks to merging iPhoto and Aperture libraries (by using the Import->Library) feature that I should be aware of?
    References images will stay referenced, managed will remain managed. You need to unhide all hidden photos in iPhoto - this cannot be done in Aperture.
    and not all the original pictures can be found by the libraries anymore, though some originals still do exist in other libraries.  Steps/process to fix?
    That is probably due to Gemini's replacing duplicate originals by links, and your best cause of action is to fix this before merging the libraries. Reconnecting can be done for your iPhoto libraries in Aperture.

  • [Desktop] Delete (obsolete) tracks in Local Files

    Since the ability to modify local file information was unhelpfully removed, I modified some names of the files themselves and re-synced them. The problem now is the old versions still appear in Local Files as well, just greyed out, and there is no option to delete them, so I have two entries for the same track. This could get very messy very quickly if I want to modify further, I will end up with multiple versions of everything I add in the Local Files list making it very difficult to find the tracks I want.

    I used to have a huge library of music on my computer. I have recently moved it to an external hard drive due to the fact that Spotify has most of the music I like, and I can find the others on Youtube or Google Play. I now have a huge local library of songs that aren't on the computer but are tied to Spotify's local library, and  Spotify defaults to playing the local files when they are available.(Even when they are selected from an artist's page) This means that when I try to play a record that was tied to that name in Spotify, nothing happens, no music. Mine are gone and now I can't listen to my favorite music that i removed specifically because it was avalible on Spotify(and other sources). Please Fix This Now!

  • What is the best way to move Contacts onto the iPhone?

    Hi Guys,
    I currently have Nokia N82, usually when i get a new Nokia (since am a TOO loyal customer) i just take a backup from the previous one and add it to the new one when i get! i hate copying to/from SIM...
    Now when i want to get the iPhone what is the best way to move the Contacts??
    i use a Windows machine, STILL!

    For the couple of iPhones I have access to, you've got three methods to get contacts onto the device aside from moving them onto the SIM; I have found that copying to and from SIMs can leave data fields not totally aligned.
    (1) Via a cloud. One uses MobileMe (via iCal/Address Book entries) and the second uses an Exchange-based cloud. Both seem to work pretty well, although I do experience an occasional lag from time to time.
    (2) Via a sync on a desktop. My preferred method. Connecting to iCal/Address Book>iTunes or Outlook 2007>iTunes work very well. My only issue was that Outlook didn't work as I'd expected the first time, just as with a couple of other phones in the past (it never did work with my Motorola Z9); to "fix" the issue, I simply refreshed Outlook's contacts and rebooted Outlook - I actually had to do the same thing with iCal to "blow out the pipes" and both sync conduits work fine now.
    (3) Transfer Contacts to the iPhone via email using a vCard for each contact. I use version 3.0-compatible vCard files generated from Address Book or Entourage (Mac), Outlook or just about what my business contacts generate. Just about every platform has some unique data type, but I haven't received a vCard yet the iPhone can't handle via email.
    Getting your Contacts out of the iPhone. Option (1) or (2) - that's it AFAIK. I hope this helps you out!

  • Best way to store photos long term?

    I'm retiring from my job as atheater teacher and would like to keep the photos I have worked spo long to get organized. What's the best way to store them?

    On an external HD. Export the photos out of iPhoto via File ➙ Export ➙ File Export with Kind=Original and SubFolder Format set to Events.
    Select the EHD as the export destination.  That will give you a set of folders with the same names as the Events in your iPHoto 9.4.3 library. 
    If you have an earlier version of iPhoto you can use iPhoto To Disk
    OT

  • Best way to save high definition video

    I recently purchased a Canon HD camcorder and hope to burn the video onto Blu Ray discs in the future. Until I get a burner, what is the best way to save the video files to preserve the 1080 HD?

    Just keep your projects and events. You can share the projects in multiple formats. Later, you can go back and share the movie as a quicktime movie that can be burned using toast. You can do this today without a bluray burner. Also, look into a little device called Western Digital Media Player. You can use this with a USB hard drive and just export your movie as HD.

  • Best way to set up a custom table using dates ytd, quarters, months

    Hello-
    I did post this on the crystal forum however it really involves setting up a good structured table in order to get the data to report on which I think we need to change which is why I'm posting here.
    I am not a dba but I work with crystal reports and we are working together to get data in tables that we can report on.  We are in the process of creating a data warehouse, which will mainly be summarized data we are exporting out of our legacy system and importing into a mysql database.  Most of this data will be summarized by month, quarter and year.  We will have multiple years of data.  A lot of the reports we will be creating will be in a comparison manner such as 2009 vs 2008 or Jan this year compared to Jan last year or list out sales by month Jan-Dec 2009.  I would like this data to be easily displayed on a report in a side by side manner.  To get this result, what is the best way to structure the data in the tables on a monthly, quarterly and yearly basis?  Right now weu2019ve got one field in the table called date (which is a string) which is listed like:
    Date
    2008YTD
    2009YTD
    2009Jan
    2008Jan
    Is it best to break out the date information so that on the report side it will be easier to work with?  Also should this be set up in the table as a date instead of a string?  If so how do you account for a YTD date?  Are we going to need 2 dates, a start and end date to achieve ytd or qtd information?  Do you recommend creating just a date table and if so how would that be structured?
    So for reporting purposes, using crystal reports, I would like to display comparison data on a report side by side, for this example this year goals compared to last years goals by goal code A-Z (which is a credit code, goals are for the # of credits by code for the year).  The end result I would like is to look like this:
    code   2009 goal   2008 goal
    A        25              20
    B        50              60
    C        10              15
    However the data looks like this (displaying all of the 2009 data first then the 2008 data, not side by side which is how it is in the table):
    code   2009 goal   2008 goal
    A        25
    B        50
    C        10
    etc to Z
    A                          20
    B                          60
    C                          15
    Right now the data is structured in the table like:
    Code  Goal  Date (this is currently a string in the db)
    A        25     YTD 2009
    B        50     YTD 2009
    etc. A-Z for 2009 then:
    A        20      YTD 2008
    B        60      YTD 2008
    Any thoughts on strucuting a table would be appreciated.  thanks.

    Jennifer,
    Most of the DW examples I've seen use a dimDateTime table in the database. That table has multiple columns related to the specific time... For example, here are the columns that are in the, SQL Server sample database, "AdventureWorkdDW"... "DimTime" table
    COLUMN_NAME             COLUMN_INFO
    TimeKey               (int, not null)
    FullDateAlternateKey     (datetime, null)
    DayNumberOfWeek          (tinyint, null)
    EnglishDayNameOfWeek     (nvarchar(10), null)
    SpanishDayNameOfWeek    (nvarchar(10), null)
    FrenchDayNameOfWeek     (nvarchar(10), null)
    DayNumberOfMonth     (tinyint, null)
    DayNumberOfYear          (smallint, null)
    WeekNumberOfYear     (tinyint, null)
    EnglishMonthName     (nvarchar(10), null)
    SpanishMonthName     (nvarchar(10), null)
    FrenchMonthName          (nvarchar(10), null)
    MonthNumberOfYear     (tinyint, null)
    CalendarQuarter          (tinyint, null)
    CalendarYear          (char(4), null)
    CalendarSemester     (tinyint, null)
    FiscalQuarter          tinyint, null)
    FiscalYear          (char(4), null)
    FiscalSemester          (tinyint, null)
    Then all of the fact table receive their date stamps by linking back to this table, using the TimeKey as a foreign key.
    HTH,
    Jason

  • Best way to create vertical slide navigation

    I would like to create a nice navigation that opens up vertically to help users get around. What is the best way to do this?
    Thanks!
    Van

    Hello,
    The rollover or dropdown menu will be the biggest issue, best way to realize that would be using a widget. I have been trying for another user to create a flyout menu, using effects triggered by advanced actions, but was not able to have this functionality more than once.
    There are some widgets coming with Captivate: did you have a look at the 'GotoSlide_AS3' widget:  it allows you to type in precisely the slides you want to offer navigation to.  It will not dropdown on rollover, user has to click.
    I do not understand your other wish: you do not want all the slides ready in the menu, only the ones that have already been visited? What if they did not visit anything yet, what do you want to show up for navigation? Which links should be disabled?
    Lilybiri

Maybe you are looking for