News for Solaris (from the horse's mouth )
Smiley face not 100% ready yet?pOpenSolaris 2008.11 has a new feature called graphical boot. We call it internally the quot;Smiley facequot;. Unfortunately this otherwise cool feature has one big problem - if you disable gdm and boot with the graphical boot you wont see the command line prompt. Which is why there is a second option in GRUB called the quot;text bootquot; which will work as the old regular text boot./p p img src=/observatory/resource/grub_text.PNG //p pThe nice thing about graphical boot is that it doesnt show you the command line prompt when you boot into X11, so beginners will not try to login in text prompt before X11 comes up (Ive seen that happening a few times). This is however quite useless on a server, which is why you can choose the second GRUB option and make it default if you want./p pBtw, I was wondering where the quot;smiley facequot; idea came from and saw this picture - do you also see the resemblance? :)/p pimg src=/observatory/resource/graphical_boot.PNG /img src=/observatory/resource/ian_murdock.jpg /br //p pbr //pSat, 29 Nov 2008
Whats new in OpenSolaris 2008.11?pGlynn Foster created a very nice quot;New and noteworthyquot; page for OpenSolaris 2008.11:/p pa href=http://www.opensolaris.com/learn/features/whats-new/200811http://www.opensolaris.com/learn/features/whats-new/200811/abr //p pBtw in case you are wondering how is the release shaping up, its coming along - a href=http://genunix.org/distributions/indiana/osol-0811-rc2-global.isoRC2 is ready now/a and final release is coming soon (obviously things are a bit slowed down right now due to the thanksgiving holiday in the US). br //pThu, 27 Nov 2008
An Introduction to Creating SMF ServicesA while back I wrote an entry on how to a href=/observatory/entry/accessing_windows_sharesaccess Windows shares/a. One limitation I ran into was the inability to mount the windows share at boot. A a href=/observatory/entry/startup_programs#comment-1226686430000comment/a to my recent post on a href=/observatory/entry/startup_programsStartup Programs/a got me thinking about alternative solutions. pI presume Im unable to mount the windows share at boot via the /etc/vfstab file because the smb client a href=/observatory/entry/what_makes_opensolaris_interesting_reason1SMF/a service that is required hasnt started yet. Well then, why not create my own SMF service, thats dependent on the smb client, to handle the mount for me?/p pWell, the first problem is that Ive never written an SMF service. This a href=http://www.sun.com/bigadmin/content/selfheal/sdev_intro.jspService Developer Introduction/a, although not quite complete, did get me pointed in the right direction. After some trial and error, I now have my own service that mounts my Windows share at boot. Right or wrong, what follows are the steps I took to get there, and should roughly apply for any type of service you may be interested in creating.br //p h2Decide on a Name and Location for the Service Manifestbr //h2 pThe service manifest is an XML file that describes your service. Before we begin writing it we need to decide where to put it and what to call it (and optionally what to create it with).br //p h3Pick a Location br //h3 blockquote /blockquote pThe service manifest file resides somewhere under font face=courier new,courier,monospace/var/svc/manifest/font. The existing smb client service manifest which my service depends on can be found at font face=courier new,courier,monospace/var/svc/manifest/network/smb/client.xml/font, so this seems like a logical location to put my new service manifest./p blockquote /blockquote h3Pick a Name/h3 blockquote /blockquote pIm going to call my service integrity, named after the Windows machine to which Im connecting. So my service manifest will be font face=courier new,courier,monospace/var/svc/manifest/network/smb/integrity.xml/font.nbsp;/p blockquote /blockquote h3Get a Good XML Editor/h3 blockquote /blockquote pOK, this is optional, but I hate XML. One thing that makes working with it bearable is a good XML editornbsp;that will parse the DTD and provide code completion, syntax checking and validation. I will be using a href=http://www.netbeans.org/NetBeans/a. Since well be editing a privilged directory, start it from the terminal using font face=courier new,courier,monospacequot;pfexec netbeansquot;/font./p p /p blockquote /blockquote h2Write the Service Manifestnbsp;/h2 pThe Service Manifest file has several required sections, which Ill introduce piece by piece. As I build up the file from scratch, each new piece that I introduce will be shown in bold type./p h3Define the DOCTYPE/h3 blockquote /blockquote pAdd the following two lines to the beginning of the XML file. If youve decided to use an XML editor, it will parse the DTD to provide code completion, etc./p blockquote preblt;?xml version=1.0?gt;lt;!DOCTYPE service_bundle SYSTEM /usr/share/lib/xml/dtd/service_bundle.dtd.1gt;/b/pre /blockquote h3Define the Service Bundlebr //h3 blockquote /blockquote pThe service bundle has two attributes, type and name.nbsp; Since were creating a service manifest, our type will be manifest. The name is arbitrary - Im using integrity:br //p blockquote prelt;?xml version=1.0?gt;lt;!DOCTYPE service_bundle SYSTEM /usr/share/lib/xml/dtd/service_bundle.dtd.1gt;blt;service_bundle type=manifest name=integritygt;lt;/service_bundlegt;/b /pre /blockquote h3Define the Service/h3 blockquote /blockquote pHere well simply give our service a name, version and type:br //p blockquote prelt;?xml version=1.0?gt;lt;!DOCTYPE service_bundle SYSTEM /usr/share/lib/xml/dtd/service_bundle.dtd.1gt;lt;service_bundle type=manifest name=integritygt;bnbsp;nbsp;nbsp; lt;servicenbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; name=network/smb/integritynbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; type=service version=1 gt; lt;/servicegt;/blt;/service_bundlegt;/pre /blockquote h3Identify if the Service may have Multiple Instancesnbsp;/h3 blockquote /blockquote pIf I had multiple Windows shares to mount, this may be true. For now, to keep things simple, Im going with a single instance:br //p blockquote prelt;?xml version=1.0?gt;lt;!DOCTYPE service_bundle SYSTEM /usr/share/lib/xml/dtd/service_bundle.dtd.1gt;lt;service_bundle type=manifest name=integritygt; lt;service name=integrity type=service version=1 gt; blt;single_instance/gt;/b lt;/servicegt;lt;/service_bundlegt; /pre /blockquote h3Define the Dependencies (if any)nbsp;/h3 blockquote /blockquote pIn my case, theres no point in trying to connect to the Windows share if the SMB client isnt running:/p blockquote prelt;?xml version=1.0?gt;lt;!DOCTYPE service_bundle SYSTEM /usr/share/lib/xml/dtd/service_bundle.dtd.1gt;lt;service_bundle type=manifest name=integritygt; lt;service name=integrity type=service version=1 gt; lt;single_instance/gt; b lt;!-- Dependencies. The SMB client must be enabled before shares can be mounted. --gt; lt;dependency name=client type=service grouping=reqiure_all restart_on=nonegt; lt;service_fmri value=svc:/network/smb/client/gt; lt;/dependencygt; /b lt;/servicegt;lt;/service_bundlegt;/pre /blockquote pNote, Ive configured this service to never restart. I could possibly look into making the service more robust in the future, but this will serve my needs for now./p blockquote /blockquote h3Define the Instance Name/h3 blockquote /blockquote pMy service has a single default instance. The guidelines recommend that all services be delivered as disabled,unless they are critical to system boot. Im not really quot;deliveringquot;this service to anyone but myself, but Ive followed thatconvention:/p blockquote p /p prelt;?xml version=1.0?gt;lt;!DOCTYPE service_bundle SYSTEM /usr/share/lib/xml/dtd/service_bundle.dtd.1gt;lt;service_bundle type=manifest name=integritygt; lt;service name=integrity type=service version=1 gt; lt;single_instance/gt; lt;!-- Dependencies. The SMB client must be enabled before shares can be mounted. --gt; lt;dependency name=client type=service grouping=reqiure_all restart_on=nonegt; lt;service_fmri value=svc:/network/smb/client/gt; lt;/dependencygt; b lt;instance name=default enabled=falsegt; lt;/instancegt;/b lt;/servicegt;lt;/service_bundlegt; /pre /blockquote blockquote /blockquote h3Define the Start and Stop Methods/h3 pThis is the meat of the service, the job were asking it to do. The service could call a script, but in my case I simply want to run mount and umount commands:br //p blockquote prelt;?xml version=1.0?gt;lt;!DOCTYPE service_bundle SYSTEM /usr/share/lib/xml/dtd/service_bundle.dtd.1gt;lt;service_bundle type=manifest name=integritygt; lt;service name=integrity type=service version=1 gt; lt;single_instance/gt; lt;!-- Dependencies. The SMB client must be enabled before shares can be mounted. --gt; lt;dependency name=client type=service grouping=reqiure_all restart_on=nonegt; lt;service_fmri value=svc:/network/smb/client/gt; lt;/dependencygt; lt;instance name=default enabled=falsegt;b lt;!-- Start method: mounts the share --gt; lt;exec_method type=method name=start exec=mount //integrity.local/MyDocuments timeout_seconds=30/gt; lt;!-- Stop method: umounts the share --gt; lt;exec_method type=method name=stop exec=umount //integrity.local/MyDocuments timeout_seconds=30 /gt;/b lt;/instancegt; lt;/servicegt;lt;/service_bundle/pre /blockquote h3Define the Property Group/h3 blockquote /blockquote pSince this is a configuration service (no processes are started), we have to specify its type in the manifest as font face=courier new,courier,monospacetransient/font. If we were writing a service for a process, this entry could be left out:br //p blockquote prelt;⁞?xml version=1.0?gt;lt;!DOCTYPE service_bundle SYSTEM /usr/share/lib/xml/dtd/service_bundle.dtd.1gt;lt;service_bundle type=manifest name=integritygt; lt;service name=integrity type=service version=1 gt; lt;single_instance/gt; lt;!-- Dependencies. The SMB client must be enabled before shares can be mounted. --gt; lt;dependency name=client type=service grouping=require_all restart_on=nonegt; lt;service_fmri value=svc:/network/smb/client/gt; lt;/dependencygt; lt;instance name=default enabled=falsegt; lt;!-- Start method: mounts the share --gt; lt;exec_method type=method name=start exec=mount //integrity.local/MyDocuments timeout_seconds=30/gt; lt;!-- Stop method: umounts the share --gt; lt;exec_method type=method name=stop exec=umount //integrity.local/MyDocuments timeout_seconds=30 /gt;b lt;property_group name=startd type=frameworkgt; lt;propval name=duration type=astring value=transient/gt; lt;/property_groupgt;/b lt;/instancegt; lt;/servicegt;lt;/service_bundlegt;/pre /blockquote p /p h3Describe the Service/h3 blockquote /blockquote pFinally we describe the service. This is the information that will appear when we query the service using the font face=courier new,courier,monospacesvcs/font command:br //p blockquote prelt;?xml version=1.0?gt;lt;!DOCTYPE service_bundle SYSTEM /usr/share/lib/xml/dtd/service_bundle.dtd.1gt;lt;service_bundle type=manifest name=integritygt; lt;service name=integrity type=service version=1 gt; lt;single_instance/gt; lt;!-- Dependencies. The SMB client must be enabled before shares can be mounted. --gt; lt;dependency name=client type=service grouping=reqiure_all restart_on=nonegt; lt;service_fmri value=svc:/network/smb/client/gt; lt;/dependencygt; lt;instance name=default enabled=falsegt; lt;!-- Start method: mounts the share --gt; lt;exec_method type=method name=start exec=mount //integrity.local/MyDocuments timeout_seconds=30/gt; lt;!-- Stop method: umounts the share --gt; lt;exec_method type=method name=stop exec=umount //integrity.local/MyDocuments timeout_seconds=30 /gt; lt;property_group name=startd type=frameworkgt; lt;propval name=duration type=astring value=transient/gt; lt;/property_groupgt; lt;/instancegt;b lt;templategt; lt;common_namegt; lt;loctext xml:lang=Cgt; integrity.local smb share configuration lt;/loctextgt; lt;/common_namegt; lt;/templategt;/b lt;/servicegt;lt;/service_bundlegt;pnbsp;/p/pre p /p /blockquote h2Check and Validate Your XML/h2 pIf you are using an XML editor such as NetBeans, verify your XML parses correctly and validates against the DTD./p blockquote /blockquote p /p h2Install the Service/h2 pOnce the service is defined, it needs to be installed. This can be done with the svccfg command as follows:br //p prebsvccfg import /var/svc/manifest/network/smb/integrity.xml/b/pre h2Manage Your Service/h2 pYou can then manage your service like any other./p h3Query/h3 prebleonard@opensolaris:~$ bsvcs integrity/bSTATE STIME FMRIdisabled 12:43:40 svc:/integrity:default/pre h3Start/h3 prebsvcadm enable integrity/b/pre h3Verbose Query/h3 prebleonard@opensolaris:~$ bsvcs -l integrity/bfmri svc:/integrity:defaultname integrity.local smb share configurationenabled falsestate disablednext_state nonestate_time Thu Nov 20 12:43:40 2008logfile /var/svc/log/integrity:default.logrestarter svc:/system/svc/restarter:defaultdependency require_all/none svc:/network/smb/client (online)/pre h3Notice your service even has its own log file.../h3 prepbleonard@opensolaris:~$ bcat /var/svc/log/integrity:default.log/b[ Nov 20 12:45:57 Enabled. ][ Nov 20 12:45:57 Executing start method (mount //integrity.local/MyDocuments). ][ Nov 20 12:45:57 Method start exited with status 0. ]nbsp;/p/pre h2And Most Importantly...br //h2 pIt accomplishes its task, in this case mounting my Windows share at boot:br //p prebleonard@opensolaris:~/IntegrityDocs$ lsCalphalon.odt My Faxes My Videos Our Money.mny Software My MusicMy eBooks My Pictures /preThu, 20 Nov 2008
OpenSolaris 2008.11 Installation FAQpI wrote an FAQ which answers many of the common questions people have when installing OpenSolaris. It also tells you how to avoid some common pitfalls (e.g. avoiding usage of extended partitions, how to recover from overwritten boot manager, etc.). If you have any additional questions or you spot any incorrections please let me know at roman dot strobl at sun dot com./p pa href=http://wikis.sun.com/display/OpenSolaris/OpenSolaris0811InstallationFAQhttp://wikis.sun.com/display/OpenSolaris/OpenSolaris0811InstallationFAQ /abr //pSat, 15 Nov 2008
Startup ProgramspA friend of mine recently asked me how to have Pidgin start when OpenSolaris is started. With some poking around its pretty easy to figure out, but to save you the poking.../p pFirst, get the information on the program you want to run at startup. You can easily find this from the Menu Editor, which you can open by right-clicking the Menu and selecting Edit Menus:br /br /img src=/observatory/resource/200811_startup_programs/EditMenu.png //p pBrowse to the program you want to run at startup:br //p pimg src=/observatory/resource/200811_startup_programs/Screenshot-MainMenu.png //p pAnd double-click (or right-click) it to view its properties:br //p pimg src=/observatory/resource/200811_startup_programs/Screenshot-LauncherProperties.png //pWith the launcher properties window still open, return to the menu and select System gt; Preferences gt; Sessions:br / pimg src=/observatory/resource/200811_startup_programs/Screenshot-Sessions.png /br /br /Click Add and copy the information from the Launcher Properties window to the New Startup Program window (Im thinking there should just be an quot;add this launcher as startup programquot; context menu):/p pimg src=/observatory/resource/200811_startup_programs/Screenshot-NewStartupProgram.png //p pAnd that should do it. Pidgin will now automatically start when OpenSolaris starts./pFri, 14 Nov 2008
OpenSolaris Ignite Newsletter Volume 2pCheck out the latest edition of the newsletter here.. a href=http://www.sun.com/emrkt/opensolaris/ignite/1108/index.htmlhttp://www.sun.com/emrkt/opensolaris/ignite/1108/index.html/a/p pIt points to a nice preview of time slider coming in 2008.11.nbsp; /p pTo subscribe to the newsletter you need to click the subscribe button and fill out all that information.nbsp; But, it is worth it. /p p br /br //pWed, 12 Nov 2008
Sharing Folders from VirtualBox on a Mac OS HostpAs of VirtualBox 2.0.4, shared folders are still not supported for Solaris guests. However, you can still share data with your host operating system using SMB. In this example Ill explain how to set up the share on Mac OS and access it from OpenSolaris./p h2Step 1: Configure Mac OS to share files/h2 pOpen the Sharing system preference and set File Sharing to On:/p pimg src=/observatory/resource/200811_sharing_folders_mac_os/Sharing.png //p pClick the Options button and select Share files and folders using SMB:/p pimg src=/observatory/resource/200811_sharing_folders_mac_os/SharingSMB.png //p p /p Note down your Macs IP address, which you can find from the Network Utility. In my case is 10.0.1.186:img src=/observatory/resource/200811_sharing_folders_mac_os/NetworkUtillity.png /nbsp;nbsp; h2Step 2: Access the share from OpenSolaris/h2 Select Network from the Places menu, which will probably only show a Windows Network icon. Click the pencil icon in the Location Bar and enter the following string: font face=courier new, courier, monospacesmb://lt;ip address of Mac OS hostgt;/font. For example:br /br /img src=/observatory/resource/200811_sharing_folders_mac_os/Screenshot-WindowsNetwork%3A10.0.1.186on10.0.1.186-FileBrowser.png /br /br /And you should see your share. Note, unless youve changed the default permissions, youll only have read access.br / p /pTue, 11 Nov 2008
OpenSolaris.com Got a FaceliftpHave you visited a href=http://www.opensolaris.comopensolaris.com/a today? If not, take a look, it has a new face and contains lots of multimedia! Congratz to Neena, the team and everyone else who contributed to the new site./p pBtw, there is now a VirtualBox image with pre-installed OpenSolaris available a href=http://www.opensolaris.com/get/index.jspin the download section/a :)br //pMon, 10 Nov 2008
Reclaiming Ctrl+SpacepLets play a little word association.../p p /p table cellspacing=1 cellpadding=1 border=0 style=width: 355px; height: 112px; tbody tr td style=width: 50%;bKeyboard Shortcutbr //b/td td style=width: 50%;bAssociationnbsp;br //b/td /tr tr td style=width: 50%;alt+tab br //td td style=width: 50%;Application Switcher br //td /tr tr td style=width: 50%;alt+F4br //td td style=width: 50%;Close Windowbr //td /tr tr td style=width: 50%; ctrl+escbr //td td style=width: 50%;Panel Menubr //td /tr tr td style=vertical-align: top;ctrl+spacebr //td td style=vertical-align: top;Input Method?br //td /tr /tbody /table p /p p /p pInput Method? Surely this is useful for some folks, but I would guess the majority of you to expect ctrl+space to be associated with code completion. My teammate Roman has already filed a a href=http://defect.opensolaris.org/bz/show_bug.cgi?id=3021defect/a for this,span title=Ctrl-Space mapping for language selection conflicts with IDEs and I was happy to learn that it has already been addressed in the upcoming 2008.11 release./span/p pspan title=Ctrl-Space mapping for language selection conflicts with IDEsFor now, if you want to leave the Input Switcher enabled, but would prefer to use a different trigger key,/span you can simply delete (or change) the trigger key by going to System gt; Preferences gt; Input Methods. Select the Trigger Keys tab and remove the Ctrl+space trigger key:/p pimg src=/observatory/resource/200810_ctrl%2Bspace/Screenshot-InputMethodPreferenceEditor.png //p pThen click OK to close the dialog. You also need to restart the keymap service before the changes will take affect:br //p prebsvcadm restart keymap /b/pre pAlternatively, if you never use the input switcher, you can disable it altogether. This will also eliminate that little flashing quot;enquot; window you see when you log into OpenSolaris :-). br //p pOn the General tab deselect quot;Enable Input Methodquot; and set the Input Method status and switcher placement setting to None:br //p pimg src=/observatory/resource/200810_ctrl%2Bspace/Screenshot-InputMethodPreferenceEditor2.png /br //p p /p pCongratulations, youve just reclaimed ctrl+space.br /br //pThu, 6 Nov 2008
Tips for Using the Keyboard in OpenSolaris TerminalpI found out that some of the important keys dont work in OpenSolaris terminal and a href=http://defect.opensolaris.org/bz/show_bug.cgi?id=3090filed a bug for this/a. I got really a useful response in the bug discussion so Id like to share these tips for using the terminal in OpenSolaris:/p ul liHome and End keys dont work as expected in the terminal, but you can use Ctrl+a and Ctrl+e to go to the beginning and to the end of the line./li /ul ul liCtrl-C is used for interrupting, but in order to copy and paste text you can use Ctrl-Shift-C and Ctrl-Shift-V (this is useful e.g. if you dont have a mouse with the middle button/wheel)./li /ul ul liDelete key doesnt work but you can map it in terminals options in Edit--gt;Profile Preference dialog in the Compatibility tab. By mapping the delete key to quot;ASCII DELquot; you get the same behavior as backspace instead of the default tilda escape character getting printed into the terminal. br //li /ul pIf you have other tips for using the keyboard in the terminal please share them in the comments to this entry.br //pWed, 5 Nov 2008