<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>startup &#8211; SMsoft &#8211; informatica e dintorni</title>
	<atom:link href="https://blog.smsoft.it/tag/startup/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.smsoft.it</link>
	<description>consigli settimanali su MacOS, GNU/Linux ed Open Source</description>
	<lastBuildDate>Fri, 21 Jan 2011 10:38:15 +0000</lastBuildDate>
	<language>it-IT</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=67398</generator>
	<item>
		<title>Avvio di scripts al boot di MAC OSX</title>
		<link>https://blog.smsoft.it/2011/01/21/avvio-di-scripts-al-boot-di-mac-osx/</link>
					<comments>https://blog.smsoft.it/2011/01/21/avvio-di-scripts-al-boot-di-mac-osx/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Fri, 21 Jan 2011 10:38:15 +0000</pubDate>
				<category><![CDATA[MacOS]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[ipfw]]></category>
		<category><![CDATA[LaunchDaemons]]></category>
		<category><![CDATA[startup]]></category>
		<guid isPermaLink="false">http://blog.smsoft.it/?p=1028</guid>

					<description><![CDATA[L&#8217;avvio di scripts al boot su OSX viene gestito da script .plist da creare nella cartella si sistema /Library/LaunchDaemons/. Segue una breve guida per avviare automaticamente uno script che imposta una regola nel firewall (vedi precedente articolo). Diventiamo root ed accediamo alla cartella LaunchDaemons. Digitiamo: [crayon-6a3f96da64023768835370/] e poi inseriamo la password; digitiamo poi: [crayon-6a3f96da64036128184473/] la ... <a title="Avvio di scripts al boot di MAC OSX" class="read-more" href="https://blog.smsoft.it/2011/01/21/avvio-di-scripts-al-boot-di-mac-osx/" aria-label="Per saperne di più su Avvio di scripts al boot di MAC OSX">Leggi tutto</a>]]></description>
										<content:encoded><![CDATA[<p>L&#8217;avvio di scripts al boot su OSX viene gestito da script .plist da creare nella cartella si sistema  <strong>/Library/LaunchDaemons/</strong>.</p>
<p>Segue una breve guida per avviare automaticamente uno script che imposta una regola nel firewall (<a href="http://blog.smsoft.it/2010/12/21/ipfw-su-mac-osx/">vedi precedente articolo</a>).</p>
<p>Diventiamo root ed accediamo alla cartella LaunchDaemons. Digitiamo:</p><pre class="urvanov-syntax-highlighter-plain-tag">sudo su</pre><p>e poi inseriamo la password; digitiamo poi:</p><pre class="urvanov-syntax-highlighter-plain-tag">cd /Library/LaunchDaemons/</pre><p>la cartella potrebbe già contenere qualche file plist.<br />
Creiamo il nostro file che chiameremo <strong>com.apple.ipfw.plist</strong>. Io uso il fidato vim, ma potete utilizzare l&#8217;editor che preferite:</p><pre class="urvanov-syntax-highlighter-plain-tag">vi com.apple.ipfw.plist</pre><p>scriviamo all&#8217;interno del file quanto segue:</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag"><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
      <string>com.apple.ipfw</string>
  <key>ProgramArguments</key>
  <array>
    <string>/sbin/ipfw</string>
    <string>add</string>
    <string>10</string>
    <string>fwd</string>
    <string>localhost,8080</string>
    <string>tcp</string>
    <string>from</string>
    <string>me</string>
    <string>to</string>
    <string>me</string>
    <string>80</string>
  </array>
        <key>RunAtLoad</key>
        <true></true>
        <key>ServiceDescription</key>
          <string>IP filter rules</string>
        <key>StandardErrorPath</key>
          <string>/var/log/ipfw.log</string>
        <key>StandardOutPath</key>
          <string>/var/log/ipfw.log</string>
        <key>UserName</key>
          <string>root</string>
        <key>GroupName</key>
          <string>wheel</string>
  </dict>
</plist></pre><p></p>
<p>Per testare il funzionamento dello script, basterà digitare:</p><pre class="urvanov-syntax-highlighter-plain-tag">launchctl start com.apple.ipfw</pre><p>dove <strong>com.apple.ipfw</strong> è il valore che avete indicato nella &#8220;Key&#8221; <strong>Label</strong> del file .plist.<br />
Per verificare che il servizio sia stato lanciato, basterà digitare:</p><pre class="urvanov-syntax-highlighter-plain-tag">launchctl list |grep com.apple.ipfw</pre><p>e per controllare che la regola sia stata effettivamente aggiunta nel firewall, basterà digitare:</p><pre class="urvanov-syntax-highlighter-plain-tag">ipfw list</pre><p></p>
<p><strong>Nota</strong>: per la creazione dei file per launchd, consiglio anche di provare il client grafico <a href="http://sourceforge.net/projects/lingon/" target="_blank" rel="noopener noreferrer">Lingon</a>.</p>
<p>enjoy</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.smsoft.it/2011/01/21/avvio-di-scripts-al-boot-di-mac-osx/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
