1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
4
<head xmlns="http://www.w3.org/1999/xhtml">
5
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
<title xmlns="">pam_motd</title>
7
<link rel="stylesheet" href="../../libs/ubuntu-book.css" type="text/css" />
8
<link rel="home" href="index.html" title="Guida a Ubuntu server" />
9
<link rel="up" href="other-useful-applications.html" title="Capitolo 22. Altre utili applicazioni" />
10
<link rel="prev" href="other-useful-applications.html" title="Capitolo 22. Altre utili applicazioni" />
11
<link rel="next" href="etckeeper.html" title="etckeeper" />
12
<link rel="copyright" href="/legal.html" title="Riconoscimenti e licenza" />
14
<link href="http://help.ubuntu-it.org/favicon.ico" rel="shortcut icon" />
16
<div id="page-border-left-repeat">
17
<div id="page-border-right-repeat">
18
<script type="text/javascript">
19
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
20
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
22
<script type="text/javascript">
24
var pageTracker = _gat._getTracker("UA-8147493-2");
25
pageTracker._trackPageview();
26
} catch(err) {}</script>
27
<div id="page-border-top-repeat">
29
<div id="header-navigation">
32
<a href="http://www.ubuntu-it.org">Web</a>
35
<a href="http://wiki.ubuntu-it.org">Documentazione</a>
38
<a href="http://forum.ubuntu-it.org">Forum</a>
41
<a href="http://planet.ubuntu-it.org">Planet</a>
45
<form action="http://help.ubuntu-it.org/10.04/ubuntu/search.php" id="cse-search-box">
47
<input type="text" name="s" size="28" title="search" />
48
<input type="submit" value="Cerca" title="search" />
55
<div class="pagelocation"><a href="http://help.ubuntu-it.org/">Documentazione di Ubuntu</a> → <a href="http://help.ubuntu-it.org/10.04/ubuntu/">Ubuntu 10.04</a> → <span class="breadcrumb-link"><a href="index.html">Guida a Ubuntu server</a></span> → <span class="breadcrumb-link"><a href="other-useful-applications.html">Altre utili applicazioni</a></span> → <span class="breadcrumb-node">pam_motd</span></div>
56
<div xmlns="http://www.w3.org/1999/xhtml" class="sect1" title="pam_motd">
57
<div class="titlepage">
60
<h2 class="title" style="clear: both"><a id="pam_motd"></a>pam_motd</h2>
64
<p>Quando si esegue l'accesso con una versione server di Ubuntu, è possibile vedere dei messaggi giornalieri di informazioni (MOTD). Queste informazioni sono ricavate e visualizzate utilizzando diversi pacchetti:</p>
65
<div class="itemizedlist">
66
<ul class="itemizedlist" type="disc">
68
<p><span class="emphasis"><em>landscape-common</em></span>: fornisce le librerie principali di <span class="application"><strong>landscape-client</strong></span>, che può essere utilizzato per la gestione di sistemi attraverso l'interfaccia web di <span class="emphasis"><em>Landscape</em></span>. Il pacchetto comprende l'utilità <span class="application"><strong>/usr/bin/landscape-sysinfo</strong></span> che può essere usata per recuperare informazioni visualizzate attraverso il MOTD.</p>
72
<span class="emphasis"><em>update-notifier-common:</em></span> is used to automatically update the MOTD via <span class="application"><strong>pam_motd</strong></span> module.
78
<span class="application"><strong>pam_motd</strong></span> executes the scripts in <code class="filename">/etc/update-motd.d</code> in order based on the number
79
prepended to the script. The output of the scripts is written to <code class="filename">/var/run/motd</code>, keeping the numerical order,
80
then concatenated with <code class="filename">/etc/motd.tail</code>.
82
<p>È possibile aggiungere delle informazioni dinamiche per il messaggio giornaliero. Per esempio, per aggiungere informazioni meteo locali:</p>
83
<div class="itemizedlist">
84
<ul class="itemizedlist" type="disc">
86
<p>Installare il pacchetto <span class="application"><strong>weather-util</strong></span>:</p>
88
<span class="command"><strong>sudo apt-get install weather-util</strong></span>
92
<p>L'utilità <span class="application"><strong>weather</strong></span> utilizza i dati METAR dalla «National Oceanic and Atmospheric Administration» e le previsioni meteo dal «National Weather Service». Per reperire informazioni locali è necessario il codice a 4 cifre ICAO. Per ottenere questo codice è possibile consultare il sito web del <a class="ulink" href="http://www.weather.gov/tg/siteloc.shtml" target="_top">National Weather Service</a>.</p>
93
<p>Benché il «National Weather Service» sia un'agenzia governativa degli Stati Uniti d'America, stazioni meteo sono disponibili in tutti il mondo. Informazioni meteorologiche potrebbero però non essere disponibili per tutte le località al di fuori del territorio americano.</p>
96
<p>Creare il file <code class="filename">/usr/local/bin/local-weather</code>, un semplice script per usare <span class="application"><strong>weather</strong></span> con il proprio indicatore ICAO locale:</p>
97
<pre class="programlisting">
101
# Prints the local weather information for the MOTD.
105
# Replace KINT with your local weather station.
106
# Local stations can be found here: http://www.weather.gov/tg/siteloc.shtml
114
<li class="listitem">
115
<p>Rendere lo script eseguibile:</p>
117
<span class="command"><strong>sudo chmod 755 /usr/local/bin/local-weather</strong></span>
120
<li class="listitem">
122
Next, create a symlink to <code class="filename">/etc/update-motd.d/98-local-weather</code>:
125
<span class="command"><strong>sudo ln -s /usr/local/bin/local-weather /etc/update-motd.d/98-local-weather</strong></span>
128
<li class="listitem">
130
Finally, exit the server and re-login to view the new MOTD.
136
You should now be greeted with some useful information, and some information about the local weather that may not be
137
quite so useful. Hopefully the <span class="application"><strong>local-weather</strong></span> example demonstrates the flexibility of
138
<span class="application"><strong>pam_motd</strong></span>.
141
<div xmlns="http://www.w3.org/1999/xhtml" class="navfooter">
143
<table width="100%" summary="Navigation footer">
145
<td width="40%" align="left"><a accesskey="p" href="other-useful-applications.html"><img src="../../libs/navig/prev.png" alt="Indietro" /></a> </td>
146
<td width="20%" align="center">
147
<a accesskey="u" href="other-useful-applications.html">
148
<img src="../../libs/navig/up.png" alt="Risali" />
151
<td width="40%" align="right"> <a accesskey="n" href="etckeeper.html"><img src="../../libs/navig/next.png" alt="Avanti" /></a></td>
154
<td width="40%" align="left" valign="top">Capitolo 22. Altre utili applicazioni </td>
155
<td width="20%" align="center">
156
<a accesskey="h" href="index.html">
157
<img src="../../libs/navig/home.png" alt="Partenza" />
160
<td width="40%" align="right" valign="top"> etckeeper</td>
166
<div id="page-border-bottom-repeat">
169
Ubuntu e Canonical sono marchi registrati da Canonical Ltd.
173
<div id="page-border-right-top"></div>
174
<div id="page-border-right-bottom"></div>
176
<div id="page-border-left-top"></div>
177
<div id="page-border-left-bottom"></div>