<?xml version="1.0" encoding='utf-8'?>
<!-- 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
-->
<?xml-stylesheet type="text/xsl" href="https://www.sunnychan.hk/blog/roller-ui/styles/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom">
    <title type="html">Sunny Chan blogs</title>
    <subtitle type="html">Can you see the Logic in my Madness?</subtitle>
    <id>https://www.sunnychan.hk/blog/sunny/feed/entries/atom</id>
            <link rel="self" type="application/atom+xml" href="https://www.sunnychan.hk/blog/sunny/feed/entries/atom?cat=Linux" />
        <link rel="alternate" type="text/html" href="https://www.sunnychan.hk/blog/sunny/" />
        <updated>2023-02-28T19:38:26+00:00</updated>
    <generator uri="http://roller.apache.org" version="6.0.1">Apache Roller</generator>
        <entry>
        <id>https://www.sunnychan.hk/blog/sunny/entry/blog-server-moved-to-rocky</id>
        <title type="html">Blog server moved to Rocky Linux 9</title>
        <author><name>Sunny Chan</name></author>
        <link rel="alternate" type="text/html" href="https://www.sunnychan.hk/blog/sunny/entry/blog-server-moved-to-rocky"/>
        <published>2023-02-28T19:38:26+00:00</published>
        <updated>2023-02-28T19:38:26+00:00</updated> 
        <category term="Linux" label="Linux" />
        <content type="html">
&lt;p&gt;&lt;p&gt;The blog server has been migrated to Rocky Linux 9 - as Centos 7 is end of life soon. Containers makes migration pretty easy - it&apos;s just as simple as moving the config files over!&lt;/p&gt;&lt;/p&gt;

</content>
    </entry>
    <entry>
        <id>https://www.sunnychan.hk/blog/sunny/entry/blog-software-updated-with-containers</id>
        <title type="html">Blog software updated with containers</title>
        <author><name>Sunny Chan</name></author>
        <link rel="alternate" type="text/html" href="https://www.sunnychan.hk/blog/sunny/entry/blog-software-updated-with-containers"/>
        <published>2021-03-07T04:44:10+00:00</published>
        <updated>2021-03-07T04:44:10+00:00</updated> 
        <category term="Linux" label="Linux" />
        <content type="html">
&lt;p&gt;&lt;p&gt;Another upgrade recently - I used to run the blog with a tomcat instance directly installed in the OS but I have just containerized it with podman. I used&amp;nbsp;&lt;a href=&quot;https://hub.docker.com/_/tomcat&quot; target=&quot;_blank&quot;&gt;Tomcat docker image&lt;/a&gt;&amp;nbsp;and basically mapped the existing data files from my home directory into the container and it pretty much works.&lt;/p&gt;&lt;p&gt;The more challenging part is to convince systemctl to start the blog container every time the system restarts. I use podman as my container runtime as it allows running the container in the user namespace instead of root, which makes it more secure. However it seems that running as user namespace makes it difficult to setup systemctl due to issues with podman. You should follow the advise in &lt;a href=&quot;https://github.com/containers/podman/issues/5094&quot; target=&quot;_blank&quot;&gt;this podman bug&lt;/a&gt; if you are having trouble:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Set Requires/After to user@&amp;lt;uid&amp;gt;.service to ensure all the user environment is setup before systemctl starts the blog container&lt;/li&gt;&lt;li&gt;You will need to run &quot;loginctl enable-linger&quot; for the user (see&amp;nbsp;&lt;a href=&quot;https://github.com/containers/podman/issues/5094#issuecomment-596121516&quot; target=&quot;_blank&quot; style=&quot;background-color: rgb(255, 255, 255);&quot;&gt;the issue comment&lt;/a&gt;)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Once it is all set it works like a treat. Now I can move my blog to any vps hosts that support docker container without dependent on the whole OS setup&lt;/p&gt;&lt;/p&gt;

</content>
    </entry>
    <entry>
        <id>https://www.sunnychan.hk/blog/sunny/entry/roller-with-https</id>
        <title type="html">Roller with https</title>
        <author><name>Sunny Chan</name></author>
        <link rel="alternate" type="text/html" href="https://www.sunnychan.hk/blog/sunny/entry/roller-with-https"/>
        <published>2018-07-24T16:40:28+00:00</published>
        <updated>2018-07-24T16:40:28+00:00</updated> 
        <category term="Linux" label="Linux" />
        <content type="html">
&lt;p&gt;&lt;p&gt;I have just migrated my roller to use https, and just for those who will need to do it later, you will need to make roller to replace all the URL with https. To do this, add the following to roller-custom.properties:&lt;/p&gt;&lt;br/&gt;
  &lt;p&gt;weblog.absoluteurl.[blog name]=https://someurl/roller&lt;/p&gt;&lt;br/&gt;
  &lt;p&gt;where blog name is the name of your blog, displayed at the top when you get into the configuration page.&amp;nbsp;&lt;/p&gt;&lt;/p&gt;

</content>
    </entry>
    <entry>
        <id>https://www.sunnychan.hk/blog/sunny/entry/updated-openjdk-build-docker-image</id>
        <title type="html">Updated OpenJDK-build docker image</title>
        <author><name>Sunny Chan</name></author>
        <link rel="alternate" type="text/html" href="https://www.sunnychan.hk/blog/sunny/entry/updated-openjdk-build-docker-image"/>
        <published>2017-09-11T22:31:07+00:00</published>
        <updated>2017-09-11T22:31:07+00:00</updated> 
        <category term="Linux" label="Linux" />
        <category term="docker" scheme="http://roller.apache.org/ns/tags/" />
        <category term="openjdk" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">
&lt;p&gt;&lt;p&gt;Since I have started my new job I have quite a bit of opportunity to do a bit of Docker deployment. So I have spend some time to update my docker image for openjdk build.&lt;/p&gt; &lt;br/&gt;
  &lt;p&gt;What&apos;s new:&lt;/p&gt; &lt;br/&gt;
  &lt;p&gt; &lt;/p&gt;&lt;br/&gt;
  &lt;ol&gt; &lt;br/&gt;
    &lt;li&gt;The image is now based on latest CentOS 7 (Oracle builds with Oracle Linux which is basically rebranded RHEL/Centos)&lt;/li&gt; &lt;br/&gt;
    &lt;li&gt;It now has a&amp;nbsp;&lt;a href=&quot;https://github.com/sunnythepooh/openjdk-build-docker/blob/master/latest/Dockerfile&quot;&gt;docker build file&lt;/a&gt;, &lt;a href=&quot;https://github.com/sunnythepooh/openjdk-build-docker&quot;&gt;git hub repo&lt;/a&gt; and &lt;a href=&quot;https://hub.docker.com/r/sunnythepooh/openjdk-build-docker/&quot;&gt;automatic build on Docker hub&lt;/a&gt; &lt;/li&gt; &lt;br/&gt;
    &lt;li&gt;The default start up will now be user openjdk, and you could mount your data directory as home.&lt;/li&gt; &lt;br/&gt;
    &lt;li&gt;I have put nano, git and hg in the image for your convience&lt;/li&gt; &lt;br/&gt;
  &lt;/ol&gt; &lt;br/&gt;
  &lt;p&gt;This image will be able to build latest JDK8 and JDK9 source code. &amp;nbsp;&lt;/p&gt; &lt;br/&gt;
  &lt;div&gt; &lt;br/&gt;
    &lt;p&gt;Here is an example on how to build an image&amp;nbsp;&lt;/p&gt; &lt;br/&gt;
    &lt;pre&gt;&lt;p&gt;#notice that you need :Z at the end of mount so that it fixes up selinux&lt;br/&gt;
#If you use default userid you can just mount your home dir (xxx = your id on host).&lt;br/&gt;
sudo docker run --rm -it -v /home/xxx:/home/openjdk:Z sunnythepooh/openjdk-build-docker:latest bash&lt;br/&gt;
&lt;/p&gt;&lt;p&gt;[openjdk@8a4bc8214db2 ~]$ hg clone http://hg.openjdk.java.net/jdk9/jdk9&lt;br/&gt;
destination directory: jdk9&lt;br/&gt;
requesting all changes&lt;br/&gt;
adding changesets&lt;br/&gt;
adding manifests&lt;br/&gt;
adding file changes&lt;br/&gt;
added 2628 changesets with 4461 changes to 468 files&lt;br/&gt;
updating to branch default&lt;br/&gt;
322 files updated, 0 files merged, 0 files removed, 0 files unresolved&lt;br/&gt;
[openjdk@8a4bc8214db2 jdk9]$ bash get_source.sh&lt;br/&gt;
WARNING: Mercurial version 2.6.3 or later is recommended. /usr/bin/hg is version 2.6.2&lt;br/&gt;
# Repositories:  corba jaxp jaxws langtools jdk hotspot nashorn&lt;br/&gt;
                corba:   hg clone http://hg.openjdk.java.net/jdk9/jdk9/corba corba&lt;br/&gt;
                 jaxp:   hg clone http://hg.openjdk.java.net/jdk9/jdk9/jaxp jaxp&lt;br/&gt;
                corba:   requesting all changes&lt;br/&gt;
                 jaxp:   requesting all changes&lt;br/&gt;
                 jaxp:   adding changesets&lt;br/&gt;
                corba:   adding changesets&lt;br/&gt;
                corba:   adding manifests&lt;br/&gt;
                 jaxp:   adding manifests&lt;br/&gt;
                corba:   adding file changes&lt;br/&gt;
                 jaxp:   adding file changes&lt;br/&gt;
                corba:   added 876 changesets with 5451 changes to 2597 files&lt;br/&gt;
                corba:   updating to branch default&lt;br/&gt;
                corba:   1201 files updated, 0 files merged, 0 files removed, 0 files unresolved&lt;br/&gt;
                jaxws:   hg clone http://hg.openjdk.java.net/jdk9/jdk9/jaxws jaxws&lt;br/&gt;
                jaxws:   requesting all changes&lt;br/&gt;
                jaxws:   adding changesets&lt;br/&gt;
                jaxws:   adding manifests&lt;br/&gt;
                jaxws:   adding file changes&lt;br/&gt;
                jaxws:   added 801 changesets with 21839 changes to 10824 files&lt;br/&gt;
                jaxws:   updating to branch default&lt;br/&gt;
                jaxws:   3760 files updated, 0 files merged, 0 files removed, 0 files unresolved&lt;br/&gt;
            langtools:   hg clone http://hg.openjdk.java.net/jdk9/jdk9/langtools langtools&lt;br/&gt;
            langtools:   requesting all changes&lt;br/&gt;
            langtools:   adding changesets&lt;br/&gt;
            langtools:   adding manifests&lt;br/&gt;
                 jaxp:   added 1153 changesets with 14751 changes to 8449 files&lt;br/&gt;
                 jaxp:   updating to branch default&lt;br/&gt;
                 jaxp:   3352 files updated, 0 files merged, 0 files removed, 0 files unresolved&lt;br/&gt;
                  jdk:   hg clone http://hg.openjdk.java.net/jdk9/jdk9/jdk jdk&lt;br/&gt;
                  jdk:   requesting all changes&lt;br/&gt;
                  jdk:   adding changesets&lt;br/&gt;
            langtools:   adding file changes&lt;br/&gt;
                  jdk:   adding manifests&lt;br/&gt;
            langtools:   added 4174 changesets with 38097 changes to 11847 files&lt;br/&gt;
            langtools:   updating to branch default&lt;br/&gt;
            langtools:   9464 files updated, 0 files merged, 0 files removed, 0 files unresolved&lt;br/&gt;
              hotspot:   hg clone http://hg.openjdk.java.net/jdk9/jdk9/hotspot hotspot&lt;br/&gt;
              hotspot:   requesting all changes&lt;br/&gt;
              hotspot:   adding changesets&lt;br/&gt;
              hotspot:   adding manifests&lt;br/&gt;
              hotspot:   adding file changes&lt;br/&gt;
                  jdk:   adding file changes&lt;br/&gt;
              hotspot:   added 12824 changesets with 78616 changes to 15832 files&lt;br/&gt;
              hotspot:   updating to branch default&lt;br/&gt;
              hotspot:   9078 files updated, 0 files merged, 0 files removed, 0 files unresolved&lt;br/&gt;
              nashorn:   hg clone http://hg.openjdk.java.net/jdk9/jdk9/nashorn nashorn&lt;br/&gt;
              nashorn:   requesting all changes&lt;br/&gt;
              nashorn:   adding changesets&lt;br/&gt;
              nashorn:   adding manifests&lt;br/&gt;
              nashorn:   adding file changes&lt;br/&gt;
              nashorn:   added 1928 changesets with 14563 changes to 4181 files&lt;br/&gt;
              nashorn:   updating to branch default&lt;br/&gt;
              nashorn:   3293 files updated, 0 files merged, 0 files removed, 0 files unresolved&lt;br/&gt;
                  jdk:   added 17287 changesets with 152446 changes to 50650 files&lt;br/&gt;
                  jdk:   updating to branch default&lt;br/&gt;
                  jdk:   27295 files updated, 0 files merged, 0 files removed, 0 files unresolved&lt;br/&gt;
# Repositories:  . corba jaxp jaxws langtools jdk hotspot nashorn&lt;br/&gt;
                    .:   cd . &amp;amp;&amp;amp; hg pull -u&lt;br/&gt;
                corba:   cd corba &amp;amp;&amp;amp; hg pull -u&lt;br/&gt;
                 jaxp:   cd jaxp &amp;amp;&amp;amp; hg pull -u&lt;br/&gt;
                jaxws:   cd jaxws &amp;amp;&amp;amp; hg pull -u&lt;br/&gt;
            langtools:   cd langtools &amp;amp;&amp;amp; hg pull -u&lt;br/&gt;
                  jdk:   cd jdk &amp;amp;&amp;amp; hg pull -u&lt;br/&gt;
              hotspot:   cd hotspot &amp;amp;&amp;amp; hg pull -u&lt;br/&gt;
              nashorn:   cd nashorn &amp;amp;&amp;amp; hg pull -u&lt;br/&gt;
                corba:   pulling from http://hg.openjdk.java.net/jdk9/jdk9/corba&lt;br/&gt;
                    .:   pulling from http://hg.openjdk.java.net/jdk9/jdk9&lt;br/&gt;
                  jdk:   pulling from http://hg.openjdk.java.net/jdk9/jdk9/jdk&lt;br/&gt;
              hotspot:   pulling from http://hg.openjdk.java.net/jdk9/jdk9/hotspot&lt;br/&gt;
              nashorn:   pulling from http://hg.openjdk.java.net/jdk9/jdk9/nashorn&lt;br/&gt;
                jaxws:   pulling from http://hg.openjdk.java.net/jdk9/jdk9/jaxws&lt;br/&gt;
            langtools:   pulling from http://hg.openjdk.java.net/jdk9/jdk9/langtools&lt;br/&gt;
                 jaxp:   pulling from http://hg.openjdk.java.net/jdk9/jdk9/jaxp&lt;br/&gt;
                jaxws:   searching for changes&lt;br/&gt;
                jaxws:   no changes found&lt;br/&gt;
              hotspot:   searching for changes&lt;br/&gt;
              hotspot:   no changes found&lt;br/&gt;
              nashorn:   searching for changes&lt;br/&gt;
              nashorn:   no changes found&lt;br/&gt;
                corba:   searching for changes&lt;br/&gt;
                corba:   no changes found&lt;br/&gt;
                    .:   searching for changes&lt;br/&gt;
                    .:   no changes found&lt;br/&gt;
            langtools:   searching for changes&lt;br/&gt;
            langtools:   no changes found&lt;br/&gt;
                 jaxp:   searching for changes&lt;br/&gt;
                 jaxp:   no changes found&lt;br/&gt;
                  jdk:   searching for changes&lt;br/&gt;
                  jdk:   no changes found&lt;br/&gt;
[openjdk@be86432ef9b0 jdk9]$ bash ./configure&lt;br/&gt;
Running generated-configure.sh&lt;br/&gt;
configure: Configuration created at Mon Sep 11 16:04:08 UTC 2017.&lt;br/&gt;
configure: configure script generated at timestamp 1496926402.&lt;br/&gt;
checking for basename... /usr/bin/basename&lt;br/&gt;
checking for bash... /usr/bin/bash&lt;br/&gt;
checking for cat... /usr/bin/cat&lt;br/&gt;
checking for chmod... /usr/bin/chmod&lt;br/&gt;
checking for cmp... /usr/bin/cmp&lt;br/&gt;
checking for comm... /usr/bin/comm&lt;br/&gt;
checking for cp... /usr/bin/cp&lt;br/&gt;
checking for cut... /usr/bin/cut&lt;br/&gt;
checking for date... /usr/bin/date&lt;br/&gt;
checking for gdiff... no&lt;br/&gt;
checking for diff... /usr/bin/diff&lt;br/&gt;
checking for dirname... /usr/bin/dirname&lt;br/&gt;
checking for echo... /usr/bin/echo&lt;br/&gt;
checking for expr... /usr/bin/expr&lt;br/&gt;
checking for file... /usr/bin/file&lt;br/&gt;
checking for find... /usr/bin/find&lt;br/&gt;
checking for head... /usr/bin/head&lt;br/&gt;
checking for gunzip... /usr/bin/gunzip&lt;br/&gt;
checking for pigz... no&lt;br/&gt;
checking for gzip... /usr/bin/gzip&lt;br/&gt;
checking for ln... /usr/bin/ln&lt;br/&gt;
checking for ls... /usr/bin/ls&lt;br/&gt;
checking for mkdir... /usr/bin/mkdir&lt;br/&gt;
checking for mktemp... /usr/bin/mktemp&lt;br/&gt;
checking for mv... /usr/bin/mv&lt;br/&gt;
checking for nawk... no&lt;br/&gt;
checking for gawk... /usr/bin/gawk&lt;br/&gt;
checking for printf... /usr/bin/printf&lt;br/&gt;
checking for rm... /usr/bin/rm&lt;br/&gt;
checking for rmdir... /usr/bin/rmdir&lt;br/&gt;
checking for sh... /usr/bin/sh&lt;br/&gt;
&amp;lt;!--------------------- MANY LINES LATER ---------------------&amp;gt;&lt;br/&gt;
====================================================&lt;br/&gt;
A new configuration has been successfully created in&lt;br/&gt;
/home/openjdk/jdk9/build/linux-x86_64-normal-server-release&lt;br/&gt;
using default settings.&lt;/p&gt;


&lt;p&gt;Configuration summary:&lt;br/&gt;
* Debug level:    release&lt;br/&gt;
* HS debug level: product&lt;br/&gt;
* JDK variant:    normal&lt;br/&gt;
* JVM variants:   server&lt;br/&gt;
* OpenJDK target: OS: linux, CPU architecture: x86, address length: 64&lt;br/&gt;
* Version string: 9-internal+0-adhoc..jdk9 (9-internal)&lt;/p&gt;


&lt;p&gt;Tools summary:&lt;br/&gt;
* Boot JDK:       openjdk version &quot;1.8.0_141&quot; OpenJDK Runtime Environment (build 1.8.0_141-b16) OpenJDK 64-Bit Server VM (build 25.141-b16, mixed mode)  (at /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.141-1.b16.el7_3.x86_64)&lt;br/&gt;
* Toolchain:      gcc (GNU Compiler Collection)&lt;br/&gt;
* C Compiler:     Version 4.8.5 (at /usr/bin/gcc)&lt;br/&gt;
* C++ Compiler:   Version 4.8.5 (at /usr/bin/g++)&lt;/p&gt;


&lt;p&gt;Build performance summary:&lt;br/&gt;
* Cores to use:   8&lt;br/&gt;
* Memory limit:   11783 MB&lt;br/&gt;
[openjdk@be86432ef9b0 jdk9]$ make images&lt;br/&gt;
Building target &apos;images&apos; in configuration &apos;linux-x86_64-normal-server-release&apos;&lt;br/&gt;
Compiling 8 files for BUILD_TOOLS_LANGTOOLS&lt;br/&gt;
Creating hotspot/variant-server/tools/adlc/adlc from 13 file(s)&lt;br/&gt;
Creating support/modules_libs/java.base/libjsig.so from 1 file(s)&lt;br/&gt;
Compiling 2 files for BUILD_JVMTI_TOOLS&lt;br/&gt;
&amp;lt;!------------------------------------- MANY LINES LATER -----------------------------------------&amp;gt;&lt;br/&gt;
----- Build times -------&lt;br/&gt;
Start 2017-09-10 16:55:14&lt;br/&gt;
End   2017-09-10 17:04:50&lt;/p&gt;


&lt;p&gt;00:09:36 TOTAL&lt;br/&gt;
-------------------------&lt;br/&gt;
Finished building target &apos;images&apos; in configuration &apos;linux-x86_64-normal-server-release&apos;&lt;/p&gt;&lt;div&gt;#You should be able to find the build under build/&lt;/div&gt;&lt;p&gt;[openjdk@192f7c9052ff jdk9]$ build/linux-x86_64-normal-server-release/images/jdk/bin/java -version&lt;br/&gt;
openjdk version &quot;9-internal&quot;&lt;br/&gt;
OpenJDK Runtime Environment (build 9-internal+0-adhoc..jdk9)&lt;br/&gt;
OpenJDK 64-Bit Server VM (build 9-internal+0-adhoc..jdk9, mixed mode)&lt;br/&gt;
&lt;/p&gt;&lt;div&gt;&lt;br/&gt;
&lt;/div&gt;&lt;/pre&gt; &lt;br/&gt;
  &lt;/div&gt; &lt;br/&gt;
  &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/p&gt;

</content>
    </entry>
    <entry>
        <id>https://www.sunnychan.hk/blog/sunny/entry/clearos_6_non_privileged_user</id>
        <title type="html">ClearOS 6 non-privileged user root access</title>
        <author><name>Sunny Chan</name></author>
        <link rel="alternate" type="text/html" href="https://www.sunnychan.hk/blog/sunny/entry/clearos_6_non_privileged_user"/>
        <published>2012-10-17T15:16:41+00:00</published>
        <updated>2012-10-17T15:16:41+00:00</updated> 
        <category term="Linux" label="Linux" />
        <category term="clearos" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">
&lt;p&gt;&lt;p&gt;Just to save myself searching for this information again:&lt;/p&gt;&lt;br/&gt;
  &lt;p&gt;In ClearOS 6 (a CentOS clone with nicer WebUI), user cannot access shells and by default you can&apos;t modify the settings within the WebUI. In order to enable user shell login, you will need to install &amp;quot;app-shell-extension-core.noarch&amp;quot; package. &lt;/p&gt;&lt;/p&gt;

</content>
    </entry>
</feed>

